Move stuff around + add lean and idris experiments
This commit is contained in:
parent
a45a4e94b3
commit
ca3f83d186
122 changed files with 1959 additions and 2 deletions
purescript/existentials/src
31
purescript/existentials/src/Main.purs
Normal file
31
purescript/existentials/src/Main.purs
Normal file
|
@ -0,0 +1,31 @@
|
|||
module Main where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Effect (Effect)
|
||||
import Effect.Console (log)
|
||||
|
||||
|
||||
main :: Effect Unit
|
||||
main = log "hello world"
|
||||
|
||||
---------- Existentials
|
||||
type ShowConstraint a = Show a => a
|
||||
|
||||
type Exists :: forall k. (k -> Type) -> Type
|
||||
type Exists c = forall r. (forall a. c a -> r) -> r
|
||||
|
||||
type Showable = Exists ShowConstraint
|
||||
|
||||
mkShowable :: forall a. Show a => a -> Showable
|
||||
mkShowable inner continue = continue inner
|
||||
|
||||
demo1 :: Showable
|
||||
demo1 = mkShowable 1
|
||||
|
||||
demo2:: Showable
|
||||
demo2 = mkShowable "a"
|
||||
|
||||
demo3:: Showable
|
||||
demo3 = mkShowable true
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue