Skip to content

Instantly share code, notes, and snippets.

@embix
Last active November 10, 2015 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save embix/7c119e3169314dbd5f61 to your computer and use it in GitHub Desktop.
Save embix/7c119e3169314dbd5f61 to your computer and use it in GitHub Desktop.
type integerString = {i:int; s:string}
let FizzThrough //: integerString -> integerString =
input =
if(input.i%3=0)
then {i=input.i;s="Fizz"}
else {i=input.i;s=input.s}
let BuzzThrough input =
if(input.i%5=0)
then {i=input.i;s=input.s+"Buzz"}
else {i=input.i;s=input.s}
let BreakThrough input =
if(input.s.Length > 0)
then {i=input.i;s=input.s+"\n"}
else {i=input.i;s=input.s}
let HasLength input = input.s.Length>0
let Print input = printf "%s" input.s
let asIntegerString i = {i=i; s=""}
[1..100]
|> List.map asIntegerString
|> List.map FizzThrough
|> List.map BuzzThrough
|> List.filter HasLength
|> List.map Print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment