
In short, what is a qualified type and how is it used? (Any examples would be appreciated.) I feel somewhat embarrassed asking, as I used to know. I dropped Haskell a while ago and am just now picking it up again, and unfortunately I have forgotten many concepts. If someone could point me to the appropriate tutorial that might be enough. For some reason, all my StartPage searches are only bringing me to documents that assume I already understand qualified types, or to books I can't afford to buy. -- frigidcode.com indicium.us

On 08/09/2012 06:54 PM, Antoine Latter wrote:
On Thu, Aug 9, 2012 at 9:56 PM, Christopher Howard
wrote: In what context are you seeing the term used?
Antoine
I'm pulling the term vaguely from memory. The idea had something to do, I think, with a type that has no other purpose than to qualify another type, and somehow makes the programming more safe. I'm not referring to qualified module imports, as someone suggested. In my mind it is associated with "safe constructors" (another concept I am relearning) but I'm not sure if the two concepts are actually related. I know there is a book called "Qualified Types: Theory and Practice" by Mark Jones http://web.cecs.pdx.edu/~mpj/pubs/thesis.html but I haven't read it. -- frigidcode.com indicium.us

On Thu, Aug 9, 2012 at 10:42 PM, Christopher Howard
On 08/09/2012 06:54 PM, Antoine Latter wrote:
On Thu, Aug 9, 2012 at 9:56 PM, Christopher Howard
wrote: In what context are you seeing the term used?
Antoine
I'm pulling the term vaguely from memory. The idea had something to do, I think, with a type that has no other purpose than to qualify another type, and somehow makes the programming more safe. I'm not referring to qualified module imports, as someone suggested.
Perhaps you're thinking of phantom types? They can be used like that. http://www.haskell.org/haskellwiki/Phantom_type
In my mind it is associated with "safe constructors" (another concept I am relearning) but I'm not sure if the two concepts are actually related.
I know there is a book called "Qualified Types: Theory and Practice" by Mark Jones http://web.cecs.pdx.edu/~mpj/pubs/thesis.html but I haven't read it.
-- frigidcode.com indicium.us
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Are you talking about "import qualified" by any chance? If so, this link explains the concept really well: http://learnyouahaskell.com/modules Good luck On 08/09/2012 09:56 PM, Christopher Howard wrote:
In short, what is a qualified type and how is it used? (Any examples would be appreciated.)
I feel somewhat embarrassed asking, as I used to know. I dropped Haskell a while ago and am just now picking it up again, and unfortunately I have forgotten many concepts.
If someone could point me to the appropriate tutorial that might be enough. For some reason, all my StartPage searches are only bringing me to documents that assume I already understand qualified types, or to books I can't afford to buy.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Christopher Howard wrote:
In short, what is a qualified type and how is it used? (Any examples would be appreciated.)
I feel somewhat embarrassed asking, as I used to know. I dropped Haskell a while ago and am just now picking it up again, and unfortunately I have forgotten many concepts.
If someone could point me to the appropriate tutorial that might be enough. For some reason, all my StartPage searches are only bringing me to documents that assume I already understand qualified types, or to books I can't afford to buy.
This is a type: [a] -> a This is a qualified type: Num a => [a] -> a You can say that qualified types are types that include constraints via the => symbol. In Haskell, you will mostly see type class constraints, but there are other possibilities as well. They are all grouped together in the notion of "qualified types". http://www.haskell.org/haskellwiki/Research_papers/Type_systems#Qualified_ty... As a practicing Haskell programmer, you don't actually need to know how the theory of qualified types works. The only thing you need to be aware of the expression "ambiguous constraint", because that's an occasional error message in GHC. Here an example: Show a => Int -> Bool -- ambiguous constraint Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com
participants (4)
-
Antoine Latter
-
Christopher Howard
-
Heinrich Apfelmus
-
Kiki Sugiaman