Naming conventions for newtype deconstructors (destructors?)
Looking into Haskell’s standard library we can see:
What’s the proper term for a function inverse to a constructor – to unwrap a value from a data type?
Edit: I’m rephrasing the question a bit. Apparently I caused some confusion because I didn’t realize that the term destructor is used in OOP for something quite different – it’s a function invoked when an object is being destroyed. In functional programming we (try to) avoid mutable state so there is no such equivalent to it. (I added the proper tag to the question.)
Using foldr to append two lists together (Haskell)
I have been given the following question as part of a college assignment. Due to the module being very short, we are using only a subset of Haskell, without any of the syntactic sugar or idiomatic shortcuts….I must write:
Why doesn’t Haskell have type-level lambda abstractions?
Are there some theoretical reasons for that (like that the type checking or type inference would become undecidable), or practical reasons (too difficult to implement properly)?
Fastest Functional Language
I’ve recently been delving into functional programming especially Haskell and F#, the prior more so. After some googling around I could not find a benchmark comparison of the more prominent functional languages (Scala,F# etc).
Misconceptions about purely functional languages?
I often encounter the following statements / arguments:
Fastest Haskell library sort implementation
I am implementing an application in Haskell and, for sorting, I use the library function Data.List.sort
. However, I was wondering whether this is the fastest sort implementation in the Haskell standard library (perhaps lists are not the best choice for efficient sorting).
Why would I use Control.Exception in Haskell?
I’m trying to really master Haskell error handling, and I’ve gotten to the point where I don’t understand why I would use Control.Exception instead of Control.Monad.Error.
does haskell have dependent types?
I know Haskell already has the ability to parametrise a type over another type (similar to template programming in C++), but I’m wondering whether Haskell can also parametrise a type over values – whether it supports dependent types. With dependent types, you can have a type that’s parametrised over integers, for example vectors of size n, matrices of size n×m, etc.
Applying Denotational Semantics to design of Programs
I’ve read a bit on denotational semantics (DS) and I’m very intrigued about the process of designing computer programs where types and functions have strong and clear mappings to mathematics.