Re[2]: [Haskell-cafe] newbie type signature question

2006-06-10 Thread Bulat Ziganshin
Hello Brian, Saturday, June 10, 2006, 3:05:25 AM, you wrote: It is possible that this feature was added to the language for the benefit of people who prefer not to use explicit type signatures but afaiu this goes against best practice where everything should always have an explicit

Re: [Haskell-cafe] newbie type signature question

2006-06-10 Thread J. Garrett Morris
On 6/9/06, Brandon Moore [EMAIL PROTECTED] wrote: data DataType m = forall m' . (Monad m') = DataType (TyEq m m') (Char - m' ()) It appears that the more intuitive formulation: data DataType m where DataType :: Monad m = (Char - m ()) - DataType m should work in GHC 6.4 /g

[Haskell-cafe] Re: Inferring types from functional dependencies

2006-06-10 Thread oleg
Jeff Harper defined typeclasses class Reciprocate a b | a - b where recip :: a - b class Multiply a b c | a b - c where (*) :: a - b - c and encountered the problem with -- Here I define a default (/) operator that uses the -- Reciprocate and Multiply class to perform division.

Re: [Haskell-cafe] Inferred type not most general?

2006-06-10 Thread Malcolm Wallace
Greg Buchholz [EMAIL PROTECTED] writes: tmap :: (b - a, b - a) - Twist b b - Twist a a ...I'm wondering why they couldn't infer the more general... tmap :: (a - b, c - d) - Twist a c - Twist b d Because the latter type involves polymorphic recursion. Standard H-M cannot infer a

RE: [Haskell-cafe] newbie type signature question

2006-06-10 Thread Brock Peabody
Brian Hulley wrote: Don't put class constraints on a data type, constraints belong only to the functions that manipulate the data. So according to this guideline you're not supposed to think of associating contraints with data: constraints are only relevant for functions which

RE: Re[2]: [Haskell-cafe] newbie type signature question

2006-06-10 Thread Brock Peabody
From: Bulat Ziganshin [mailto:[EMAIL PROTECTED] when you work with C++ or some other OOP language, you can define that some field in structure should some some specific interface and this allows to use functions of this interface on this field. i required the same feature in Haskell, for

[Haskell-cafe] Lambda abstraction analogous to imperative pseudo-code?

2006-06-10 Thread Clifford Beshers
The Wikipedia article on lambda abstractions (http://en.wikipedia.org/wiki/Lambda_abstraction) has a statement that does not resonate with me: A lambda abstraction is to a functional programming language such as Scheme what pseudo-code is to an imperative programming language. Does anyone

Re: [Haskell-cafe] Lambda abstraction analogous to imperative pseudo-code?

2006-06-10 Thread Robert Dockins
On Saturday 10 June 2006 04:35 pm, Clifford Beshers wrote: The Wikipedia article on lambda abstractions (http://en.wikipedia.org/wiki/Lambda_abstraction) has a statement that does not resonate with me: A lambda abstraction is to a functional programming