1
Fork 0

Move stuff around + add lean and idris experiments

This commit is contained in:
Matei Adriel 2023-10-29 00:02:10 +02:00
parent a45a4e94b3
commit ca3f83d186
122 changed files with 1959 additions and 2 deletions
purescript/existentials/src

View 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