Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Type * and * -> * (Galaxy Being)
   2.  Product/tuple type vs. ... (Galaxy Being)


----------------------------------------------------------------------

Message: 1
Date: Tue, 16 Mar 2021 14:12:06 -0500
From: Galaxy Being <borg...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Type * and * -> *
Message-ID:
        <cafahfsxajfv3nhvojygm+jdjmgsfq1x53+ve3os8nhkot7d...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

This is great stuff. I thank everybody.

On Sun, Mar 14, 2021 at 5:42 AM Erik Dominikus <erik.dominiku...@gmail.com>
wrote:

> > There's something fundamental I'm missing.
>
> It is not necessarily true, but useful, to think that:
>
> - A *type is* a set of values.
> - A *kind* as a set of types.
> - The *kind* * is the set of all types.
> - The *kind* * -> * is the set of every function with domain * and
> codomain *.
> - The *type* T -> U is the set of every function with domain T and
> codomain U, if each of T and U is a type (a set of values).
>
> For example:
>
> - The type *Bool* is the set {False, True}.
> - The type *Maybe Bool* is the set {Nothing, Just False, Just True}.
> - *Maybe* is a function such that Maybe(T) = { Nothing } union { Just t |
> t in T }.
> - *Maybe* is not a type; *Maybe Bool* is a type.
> - *a -> a* is the set { \ x -> x }.
>
> Currying and application can happen at both the value level and the type
> level:
>
> - The kind of *Either* is ** -> * -> **.
> - The kind of *Either a* is ** -> **, if the kind of *a* is ***.
> - The kind of *Either a b* is ***, if the kind of *a* is *** and the kind
> of *b* is ***.
> - The type of *Just* is *a -> Maybe a*.
> - The type of *Just x* is *Maybe a*, if the type of *x* is *a*.
>
> > Why is it giving two separate treatments?
>
> It is to show the various ways one *can* 
> implement/represent/realize/concretize/encode/model
> a mathematical construction in Haskell.
>
> You *can* (do type-level programming in Haskell, use all features of C++,
> eat spaghetti with a straw, etc.), but the real question has always been:
> *should* you?
>
> > If anyone knows of a really thorough and definitive *and *understandable
> treatment of Haskell types, I'd appreciate it.
>
> If you mean Haskell 98, then the Haskell 98 Report [1] (especially Chapter
> 4) seems "thorough and definitive", but I don't know whether you will find
> it "understandable".
>
> If you mean the latest Haskell as implemented by GHC, I don't know.
>
> [1] https://www.haskell.org/onlinereport/
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210316/c611c167/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 16 Mar 2021 14:34:26 -0500
From: Galaxy Being <borg...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: [Haskell-beginners] Product/tuple type vs. ...
Message-ID:
        <cafahfsvvvsc5qr7njbcvsknatjwht1bnv6qc4j1fa4es0uu...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Reading this
<https://www.cefns.nau.edu/~edo/Classes/CS396_WWW/Misc_docs/Haskell.html>
I'm a bit confused but think I understand what is meant by a *product
*or *tuple
*type constructor such as

data Point a b = Pt a b

Because Point has no "logical or," (|) of more than one possible value set
such as

data Color = Red | Green | Blue

 it is automatically a tuple type? Also, it has no possible "consing" --
does that play a role?

data Things a = T1 a (Things a) | T2 a (Things a) | LastT a

Things is also parameterized just like Point, but, again, Things is not a
tuple type for the reasons above, e.g., just having one parameterized
constructor means automatically a tuple type, right?

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210316/5c2924c7/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 152, Issue 8
*****************************************

Reply via email to