some terminology

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

some terminology

Michael Mossey
I was looking at some code, saw a variable x, and said to myself, "Ah that
variable is a monad." Then I realized "Monad" is the name of a type class. So
maybe x should be called "an instance of a Monad." I think the word "instance"
in this case is OO-like; but in Haskell "instance" refers to a type that is an
instance of a type class. Or maybe it can refer to both? And Monad is a type
class, not a type. Maybe I need the phrase "monadic type" to refer to an
instance of a type class. So maybe x is just "a variable of a monadic type"?

Thanks,
Mike
Reply | Threaded
Open this post in threaded view
|

some terminology

Brandon S Allbery KF8NH
On Aug 12, 2009, at 21:59 , Michael P Mossey wrote:
> I was looking at some code, saw a variable x, and said to myself,  
> "Ah that variable is a monad." Then I realized "Monad" is the name  
> of a type class. So maybe x should be called "an instance of a  
> Monad." I think the word "instance" in this case is OO-like; but in  
> Haskell "instance" refers to a type that is an instance of a type  
> class. Or maybe it can refer to both? And Monad is a type class, not  
> a type. Maybe I need the phrase "monadic type" to refer to an  
> instance of a type class. So maybe x is just "a variable of a  
> monadic type"?


Strictly speaking, yes.  In practice the common shorthand is "in the X  
monad" or just "in X".

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [hidden email]
system administrator [openafs,heimdal,too many hats] [hidden email]
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20090812/8d3aff21/PGP.bin
Reply | Threaded
Open this post in threaded view
|

Re: some terminology

Heinrich Apfelmus
In reply to this post by Michael Mossey
Michael P Mossey wrote:
> I was looking at some code, saw a variable x, and said to myself, "Ah
> that variable is a monad." Then I realized "Monad" is the name of a type
> class. So maybe x should be called "an instance of a Monad." I think the
> word "instance" in this case is OO-like; but in Haskell "instance"
> refers to a type that is an instance of a type class. Or maybe it can
> refer to both? And Monad is a type class, not a type. Maybe I need the
> phrase "monadic type" to refer to an instance of a type class. So maybe
> x is just "a variable of a monadic type"?

One common nomenclature is to say that  x  is a "monadic action" or just
 "action" for short. That's the terminology used in the

  Simon Peyton Jones.  Tackling the awkward squad.
  http://research.microsoft.decenturl.com/awkward-squad

tutorial.


Regards,
apfelmus

--
http://apfelmus.nfshost.com

Reply | Threaded
Open this post in threaded view
|

Re: some terminology

Maurí­cio CA
In reply to this post by Michael Mossey
> I was looking at some code, saw a variable x, and said to myself, "Ah
> that variable is a monad." Then I realized "Monad" is the name of a type
> class. So maybe x should be called "an instance of a Monad." I think the
> word "instance" in this case is OO-like; but in Haskell "instance"
> refers to a type that is an instance of a type class. [...]

In general, it helps to know that the current "de facto" Haskell standard
actually accepts classes and instances built on top of many types:

class SomeClass a b c where
   someF :: a -> b -> c
   anotherF :: b -> c -> a

instance SomeClass T1 T2 T3 where
   someF = ...
   anotherF = ...


This way it becomes clear that saying that some type "is of" or
"instantiate" some class isn't apropriate.

Best,
Maur?cio