Skip to content

Instantly share code, notes, and snippets.

@oleks
Last active March 26, 2017 12:35
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 oleks/4b12ce8fdbeeeb835fff0670fbf71416 to your computer and use it in GitHub Desktop.
Save oleks/4b12ce8fdbeeeb835fff0670fbf71416 to your computer and use it in GitHub Desktop.
module Expr
data Expr = X
| Plus (Expr, Expr)
Show Expr where
show X = "x"
show (Plus (e_left, e_right)) = (show e_left) ++ " + " ++ (show e_right)
{-
$ idris
Idris> :l Expr.idr
*Expr> show (Plus (X,X))
prim__concat (Expr.Expr implementation of Prelude.Show.Show, method show X)
(prim__concat " + " (Expr.Expr implementation of Prelude.Show.Show, method show X)) : String
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment