Skip to content

Instantly share code, notes, and snippets.

@jeetu7
Created April 14, 2020 17:07
Show Gist options
  • Save jeetu7/c16b1c2931d74d8f8d04f56626559f74 to your computer and use it in GitHub Desktop.
Save jeetu7/c16b1c2931d74d8f8d04f56626559f74 to your computer and use it in GitHub Desktop.
casting trial in idris2
module Main
x1 : Int
x1 = 2
doubleToInt : Double -> Int
doubleToInt y = cast y
x2 : Double
x2 = 5.3
main : IO ()
main = do printLn $ x1
printLn $ doubleToInt x2
@jeetu7
Copy link
Author

jeetu7 commented Apr 14, 2020

==Idrirs1 ==
/tmp ➤ ./trycast
2
5

== idris2 ==
/tmp ➤ ./build/exec/trycast
2
5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment