Haskell - Declaring the type of multiple functions -


i find myself writing multiple functions same type. let's call type functype. might write this:

funca :: functype funcb :: functype funcc :: functype funcd :: functype  -- implementations 

this feels lot of unnecessary typing (typing in tapping on keyboard, not declaring types of functions). there maybe way more concisely? want along lines of:

(funca, funcb, funcc, funcd) :: functype  -- implementations 

i tried google came empty. if isn't feature of language, why not? missing something? doing wrong if find myself needing this?

do tried without parentheses.

funca, funcb, funcc, funcd :: functype 

in haskell 2010 report, can see in chapter 4 (declarations , bindings) type signature (gendecl) looks this:

vars :: [context =>] type 

and vars this:

var-1 , … , var-n 

which form you're looking for.


sidenote: haddock apply documentation if finds around type signature to every symbol in (vars) list.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -