#haskell - Thu 26 Apr 2007 between 02:26 and 02:36



pchiusanocan somebody take a look at my paste and help
jcreighpchiusano: if you "import Text.Show.Functions", you can solve the "Show" problem.
pchiusanook
Korollarypchiusano: I think the Eq problem stays
jcreighpchiusano: I don't know of any simple way to do Eq other than defining it manually, however.
pchiusanoso, I have to define Eq manually for my entire datatype...?
because there is a single ctor for which the default impl doesn't apply?
KorollaryI dont think you can do it manually either. How are you going to prove that two functions are equal?
jcreighwell, you can define Eq for Expr -> Expr, and then derive Eq for Expr.
(I assume you would just always return False?)
pchiusanojcreigh: yes
dmeadsighface
augustss> (-1) `mod` 3
lambdabot2
KorollaryWhy do you need Eq anyway? Is this for an interpreter?
pchiusanoya
TomMDlet f = (\x -> sum (map fromEnum (x::String))) in f "Haskell" > f "Python"
> let f = (\x -> sum (map fromEnum (x::String))) in f "Haskell" > f "Python"
lambdabotTrue
TomMDexcellent.
Korollarypchiusano: You can implement the interpreter without the Eq instance. Why do you need Eq?
dmeadpchiusano, you could make axiom a different type
pchiusanowell, I need
some way of comparing the equality of expressions
dmeadi'll annotate
pchiusanoya, dmead, I was going to ask you to show me
KorollaryYou just rephrased it. I still don't know why you need equality between expressions.
pchiusanohehe
campusblohi
is there a way to convert haskell to php?
KorollaryI don't know of such a compiler.
pchiusanodude, just trust me, I need it! plus, that is not entirely the point
dmeadpchiusano, what do you want from Expr -> Expr
an actual mapping?
or just to show an arrow
pchiusanoer, what do you mean?
dmeadyou don't need to type -> i think
pchiusanoyou mean to display it?
dmeadjust Axoim Expr Expr
yea

Page: 2 9 16 23 30 37 44 51 58 65 72 79 

IrcArchive