Last active
December 20, 2021 20:24
-
-
Save prednaz/8d96a7a893fec388feae5e8149348fd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language | |
GADTSyntax, | |
FlexibleInstances | |
#-} | |
import Prelude hiding (String) | |
import qualified Prelude | |
main :: IO () | |
main = print sample | |
-- \f -> f (\FormalParameter -> Haar (Iets FormalParameter)) (\FormalParameter -> Willen (Laten (Zeggen FormalParameter))) | |
sample :: Tup | |
sample = want (let_ (say something) her) | |
type String = Star -> Star | |
type Tup = (String -> String -> Prelude.String) -> Prelude.String | |
her :: String | |
her = Haar | |
something :: String | |
something = Iets | |
say :: String -> Tup | |
say = \x f -> f x Zeggen | |
want :: Tup -> Tup | |
want = \q f -> q (\y z -> f y (Willen . z)) | |
let_ :: Tup -> String -> Tup | |
let_ = \q x f -> q (\z w -> f (x . z) (Laten . w)) | |
data Star where | |
Haar :: Star -> Star | |
Iets :: Star -> Star | |
Zeggen :: Star -> Star | |
Laten :: Star -> Star | |
Willen :: Star -> Star | |
FormalParameter :: Star | |
deriving Show | |
instance Show String where | |
show s = "\\FormalParameter -> " ++ show (s FormalParameter) | |
instance Show ((String -> String -> Prelude.String) -> Prelude.String) where | |
show tup = | |
tup | |
(\a b -> | |
"\\f -> f (" ++ show a ++ ") (" | |
++ | |
show b ++ ")" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment