File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -116,9 +116,7 @@ examples =
116
116
(" FFI" ,
117
117
unlines [ " foreign import data IO :: * -> *"
118
118
, " "
119
- , " foreign import console :: {"
120
- , " log :: String -> IO { }"
121
- , " }"
119
+ , " foreign import console :: { log :: String -> IO { } }"
122
120
, " "
123
121
, " main = console.log \" Hello World!\" "
124
122
]))
@@ -145,6 +143,21 @@ examples =
145
143
, " "
146
144
, " test = Test:incr 10"
147
145
]))
146
+ , (" rank2" ,
147
+ (" Rank N Types" ,
148
+ unlines [ " type Nat = forall a. a -> (a -> a) -> a"
149
+ , " "
150
+ , " zero :: Nat"
151
+ , " zero = \\ a f -> a"
152
+ , " "
153
+ , " succ :: Nat -> Nat"
154
+ , " succ = \\ n a f -> f (n a f)"
155
+ , " "
156
+ , " type Lens a b = forall f. (a -> f a) -> b -> f b"
157
+ , " "
158
+ , " compose :: forall a b c. Lens a b -> Lens b c -> Lens a c"
159
+ , " compose = \\ l1 l2 f -> l2 (l1 f)"
160
+ ]))
148
161
]
149
162
150
163
page :: Maybe String -> Maybe Response -> ActionM ()
You can’t perform that action at this time.
0 commit comments