mirror of
https://github.com/aelve/guide.git
synced 2024-11-25 18:56:52 +03:00
353 B
353 B
{{Multiple}}["Code1", "Code2", "Code3", "Code4"] {{Choice}}["Code4" : "-- | Compute factorial (12...n)"] factorial :: Int -> {{Choice}}["Code1" : "Int"; "Code2", "Code3", "Code4" : "Integer"] factorial n = {{Choice}}["Code1", "Code2" : "product"; "Code3", "Code4" : "foldl' 1 ()"] [1..{{Choice}}["Code2", "Code3", "Code4" : "fromIntegral "]n]