is there any way for multiple where statement in Haskell -


i tried write 3-4 statement in 1 function error , couldnt , tried :

foo x= | x == foo1 = 5 | x == foo2 =3 | x == foo3 =1 | otherwise =2  foo1= samplefunct1 x       foo2= samplefunct2 x       foo3= samplefunct3 x 

i know code bit useless wrote give example mean.

is there can me ? in advance.

remove = after foo x , indent code like

foo x     | x == foo1 = 5     | x == foo2 =3     | x == foo3 =1     | otherwise =2      foo1 = samplefunct1 x           foo2 = samplefunct2 x           foo3 = samplefunct3 x 

and you're fine.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -