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.  Lifting over record syntax (Jaakko Luttinen)
   2. Re:  I can't start WinGHCi Haskell (Ut Primum)


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

Message: 1
Date: Sun, 14 Oct 2018 10:15:06 +0300
From: Jaakko Luttinen <jaakko.lutti...@iki.fi>
To: beginners@haskell.org
Subject: [Haskell-beginners] Lifting over record syntax
Message-ID: <294a3680-dead-c2d0-8796-34f15bc9a...@iki.fi>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi!

Let's consider this simple data structure:

data Person = Person {name::String, age::Int} deriving Show

Now, I can create maybe-people like in applicative style:

Person <$> Just "John Doe" <*> Nothing

or in monad style:

do
   name' <- Just "John Doe"
   age' <- Nothing
   return Person {name=name', age=age'}

The problem with the first approach is that it depends on the order of 
the arguments because it doesn't utilize the record syntax. The problem 
with the second approach is that there's a bit of unnecessary 
boilerplate (e.g., name' and age' variables).

I would like to get the benefits of the the record syntax but with 
similar code simplicity as the applicative style has. Do you have ideas 
is this possible? My non-working pseudo-code would look like:

Person <$> {name=Just "John Doe", age=Nothing}

But this doesn't work, it's syntax error.

Any ideas for a nice syntax?

Cheers,
Jaakko


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

Message: 2
Date: Sun, 14 Oct 2018 09:49:38 +0200
From: Ut Primum <utpri...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] I can't start WinGHCi Haskell
Message-ID:
        <CANjDmKJp=dprqhefvhwxmquqkx-+-jhw0tv9grwddscwcw4...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Sometimes this kind of errors are caused by the fact that the PATH
environment variable hasn't been modified correctly during installation, so
maybe you should do it manually

Il dom 14 ott 2018, 02:58 Brody Berg <brodyb...@gmail.com> ha scritto:

> Looks like it isn’t installed correctly - or something it depends on is
> missing.
>
> On Sat, Oct 13, 2018 at 17:45 Gustavo Arturo Marquez Flores <
> gmarq...@ciencias.unam.mx> wrote:
>
>> Hi,
>>
>>    I want to start  with Haskell language programming. But when I launch
>> the WinGHCi program I got he followin message:
>>
>> [image: image.png]
>>
>> What can I do ? How to resolve this problem ? I use Windows 10 plataform.
>>
>> I aprecite your help for resolving this problem to me.
>>
>> Thanks a lot.
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
> _______________________________________________
> 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/20181014/75123003/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 45599 bytes
Desc: not available
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20181014/75123003/attachment.png>

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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 124, Issue 12
******************************************

Reply via email to