Generator/Exponential: Difference between revisions
m
→{{header|AppleScript}}: Tidied.
(Updated to compile with Nim 1.4: added an Iterator type, added parameter and function types, changed ".. <" to "..< ", etc.) |
m (→{{header|AppleScript}}: Tidied.) |
||
Line 339:
{{Trans|JavaScript}}
{{Trans|Python}}
<lang applescript>-----------------
-- powers :: Gen [Int]
on powers(n)
script f
Line 350 ⟶ 352:
-
on run
take(10, ¬
Line 360 ⟶ 362:
-
-- Just :: a -> Maybe a
Line 366 ⟶ 368:
{type:"Maybe", Nothing:false, Just:x}
end Just
-- Nothing :: Maybe a
Line 371 ⟶ 374:
{type:"Maybe", Nothing:true}
end Nothing
-- Tuple (,) :: a -> b -> (a, b)
|