Last time we created our Phantom type and successfully converted it to a list. Let’s quickly review the goals of our Phantom type before pushing forward.
The primary [...]
|
||||||
|
Last time we created our Phantom type and successfully converted it to a list. Let’s quickly review the goals of our Phantom type before pushing forward.
The primary [...] With Halloween tomorrow, now is the perfect time to take a look at phantom types in F#. So what are phantom types? Think of them as a way to embed a constraint into the type system of a language. Here’s a great example of using them [...] We may not have proper type class constraint support in F#, but we can still make sure our ‘square’ function doesn’t blow up at runtime.
Passing the Dictionary of Operations Explicitly
In the comments of the last post, Cale Gibbard noted that the monad abstraction is pointless unless you can write code that works against the abstraction, instead of a particular instance. Haskell let’s you write work with the monad abstraction through the use of type classes. This ad hoc form of polymorphism [...] |
||||||
|
Copyright © 2010 Do Loop Until You Die - All Rights Reserved |
||||||