[Haskell-beginners] Simple function comparison

Stephen Renehan d11124067 at mydit.ie
Wed Nov 25 11:39:15 UTC 2015


I'm looking to do a comparison between 2 simple functions to see if
they are equivalent but I appear to be running into some problems if
anyone can help.

The two functions I want to compare are f (g a) and g (f a).

I have f defined and g defined as
 f :: a -> a
 f = undefined

g :: a -> a.
g =  undefined

The compiler was complaining about the type signature lacking a
binding so added undefined to get around the error. I understand that
I must be missing something very basic as they look incomparable in
this form. Any suggestions of what changes I should make such a
comparison practical?

Many thanks,



This email originated from DIT. If you received this email in error, please 
delete it from your system. Please note that if you are not the named 
addressee, disclosing, copying, distributing or taking any action based on 
the contents of this email or attachments is prohibited. www.dit.ie

Is ó ITBÁC a tháinig an ríomhphost seo. Má fuair tú an ríomhphost seo trí 
earráid, scrios de do chóras é le do thoil. Tabhair ar aird, mura tú an 
seolaí ainmnithe, go bhfuil dianchosc ar aon nochtadh, aon chóipeáil, aon 
dáileadh nó ar aon ghníomh a dhéanfar bunaithe ar an ábhar atá sa 
ríomhphost nó sna hiatáin seo. www.dit.ie

Tá ITBÁC ag aistriú go Gráinseach Ghormáin – DIT is on the move to 
Grangegorman <http://www.dit.ie/grangegorman>

More information about the Beginners mailing list