Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: latest Haskell Platform build fails (Michael Martin)
2. Re: latest Haskell Platform build fails (Mateusz Kowalczyk)
3. Re: How to override a type class instance ?
(Johannes Joachim Engels)
4. Trouble Understanding How to Start (Keeley Abbott)
5. Re: Trouble Understanding How to Start (Bob Ippolito)
6. Re: latest Haskell Platform build fails (emacstheviking)
----------------------------------------------------------------------
Message: 1
Date: Sat, 18 Oct 2014 07:16:21 -0500
From: Michael Martin <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] latest Haskell Platform build fails
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 10/18/2014 02:31 AM, Heinrich Apfelmus wrote:
> Michael L Martin wrote:
>> On 10/16/2014 03:11 PM, Mateusz Kowalczyk wrote:
>>> Merely going from the error message and your steps, it seems to me that
>>> you're *not* meant to install GHC yourself first and that the platform
>>> ships with GHC. I would say try again but without installing GHC and
>>> cabal first.
>>>
>>>
>> Well, that didn't work, either:
>>
>> mmartin@cloud:~/Downloads/haskell-platform-2014.2.0.0$ ./platform.sh
>> .../ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
>> ../platform.sh: 18: ./platform.sh: cabal: not found
>> ***
>> *** Building hptool
>> ***
>> ../platform.sh: 29: ./platform.sh: cabal: not found
>> mmartin@cloud:~/Downloads/haskell-platform-2014.2.0.0$
>
> Apparently, different distributions of the Haskell Platform differ in
> what tools they package: the binary distribution includes GHC and
> cabal, whereas the source distribution, which you are currently trying
> to install, doesn't include GHC and cabal.
>
> Judging from the error message
>
> > Stderr:
> > mtl-2.1.3.1: package(s) with this id already exist: mtl-2.1.3.1
>
> it seems that the platform tries to build the `mtl` package, but fails
> because it is already installed. You can use the command
>
> $ ghc-pkg list
>
> to see which packages are installed globally and in your home
> directory. Most likely, `mtl` got installed because you installed
> `cabal-install`. I have no idea how to deal with the conflict, though,
> I'm not really familiar with the Haskell platform source distribution.
>
>
> Best regards,
> Heinrich Apfelmus
>
> --
> http://apfelmus.nfshost.com
>
Thanks, Heinrich.
I find it astonishing that build/install fails because it finds that a
dependency that it needs is already
installed. This is totally unreasonable. I was really looking forward to
experimenting with Cloud Haskell,
but the pain of installation, coupled with Haskell's well-known issues
with "dependency hell", have
soured me on Haskell. The language itself is amazing - I really like it.
But I'm afraid that the dysfunctional
nature of the Haskell ecosystem is driving me back to Erlang/OTP. OTP
has proven to be industrial
strength. I hope that someday (soon), Haskell will be able to claim
that, as well.
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 2
Date: Sat, 18 Oct 2014 13:40:45 +0100
From: Mateusz Kowalczyk <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] latest Haskell Platform build fails
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
On 10/18/2014 01:16 PM, Michael Martin wrote:
>
> On 10/18/2014 02:31 AM, Heinrich Apfelmus wrote:
>> Michael L Martin wrote:
>>> On 10/16/2014 03:11 PM, Mateusz Kowalczyk wrote:
>>>> Merely going from the error message and your steps, it seems to me that
>>>> you're *not* meant to install GHC yourself first and that the platform
>>>> ships with GHC. I would say try again but without installing GHC and
>>>> cabal first.
>>>>
>>>>
>>> Well, that didn't work, either:
>>>
>>> mmartin@cloud:~/Downloads/haskell-platform-2014.2.0.0$ ./platform.sh
>>> .../ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
>>> ../platform.sh: 18: ./platform.sh: cabal: not found
>>> ***
>>> *** Building hptool
>>> ***
>>> ../platform.sh: 29: ./platform.sh: cabal: not found
>>> mmartin@cloud:~/Downloads/haskell-platform-2014.2.0.0$
>>
>> Apparently, different distributions of the Haskell Platform differ in
>> what tools they package: the binary distribution includes GHC and
>> cabal, whereas the source distribution, which you are currently trying
>> to install, doesn't include GHC and cabal.
>>
>> Judging from the error message
>>
>>> Stderr:
>>> mtl-2.1.3.1: package(s) with this id already exist: mtl-2.1.3.1
>>
>> it seems that the platform tries to build the `mtl` package, but fails
>> because it is already installed. You can use the command
>>
>> $ ghc-pkg list
>>
>> to see which packages are installed globally and in your home
>> directory. Most likely, `mtl` got installed because you installed
>> `cabal-install`. I have no idea how to deal with the conflict, though,
>> I'm not really familiar with the Haskell platform source distribution.
>>
>>
>> Best regards,
>> Heinrich Apfelmus
>>
>> --
>> http://apfelmus.nfshost.com
>>
> Thanks, Heinrich.
>
> I find it astonishing that build/install fails because it finds that a
> dependency that it needs is already
> installed. This is totally unreasonable. I was really looking forward to
> experimenting with Cloud Haskell,
> but the pain of installation, coupled with Haskell's well-known issues
> with "dependency hell", have
> soured me on Haskell. The language itself is amazing - I really like it.
> But I'm afraid that the dysfunctional
> nature of the Haskell ecosystem is driving me back to Erlang/OTP. OTP
> has proven to be industrial
> strength. I hope that someday (soon), Haskell will be able to claim
> that, as well.
>
Why don't you use [1] instead of getting the source binary and finding
yourself struggling? It comes with GHC.
[1]: http://www.haskell.org/platform/linux.html#binary
--
Mateusz K.
------------------------------
Message: 3
Date: Sat, 18 Oct 2014 15:06:46 +0000
From: Johannes Joachim Engels <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [Haskell-beginners] How to override a type class instance
?
Message-ID:
<4d9b1ca5e471e143a1ac4eb5c3dd5bca213...@exdb02.ad.hft-stuttgart.de>
Content-Type: text/plain; charset="us-ascii"
> You usually wrap the data type in a newtype and use
> GeneralizedNewtypeDeriving to derive the classes you want to keep. Then
> write custom instances for the type classes you want to override.
thank you very much, this worked!
Best regards
Johannes
------------------------------
Message: 4
Date: Sat, 18 Oct 2014 08:08:16 -0700
From: Keeley Abbott <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Trouble Understanding How to Start
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Hi All,
So, I am taking a Functional Programming class this fall, and I have struggling
to understand how to build types and functions correctly. For some reason it
just isn?t clicking. I have the following module I am working on, and I need
some guidance.
? Variable names
type Name = String
? An environment for looking up the value of a variable
type Env = Name -> Maybe Int
? An empty environment
empty :: Env
empty env = Nothing
? Set a variable to a value in the environment if it doesn?t already exist
set :: Name -> Int -> Env -> Env
set x i e = \y -> if x == y then (Just i) else e y
? Lookup the value of a variable in the environment
get :: Name -> Env -> Int
get x env = ?? (I previously had ?type Env = Name -> Int?, so this was working
with env x, but we had to change empty to be something other than just a
runtime error, which is why I made Env = Name -> Maybe Int)
?Remove a variable from the environment
unset :: Name -> Env -> Env
unset x e = \y -> if x == y then empty x else env y
At this point I don?t know how to fix get, so I get an int to display (it keeps
telling me it can?t match the type ?Maybe Int? with the expected type ?Int?).
And I don?t know where to go from there to create getOr, setAll, and mapEnv
functions, because I am just not understanding what I am doing. For the most
part I have been doing simpler things that I could just mess with the functions
until they work, but even at that I?m not getting HOW they work? Any assistance
or instruction on how I can GET what I am trying to do would be greatly
appreciated.
Thanks,
Kallarhynn
------------------------------
Message: 5
Date: Sat, 18 Oct 2014 09:26:18 -0700
From: Bob Ippolito <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Trouble Understanding How to Start
Message-ID:
<cacwmpm-a9igbywsqdwh5amkrf3y92ormek+ckdjvg8n_uyj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
What is `get` supposed to do when there is no variable equal to `x`? The
type should be `Name -> Env -> Maybe Int`, there should be some additional
argument for the default value, or there should be some hard-coded default
value.
If you were using a hard-coded default value of `-1` it might look like
this:
get :: Name -> Env -> Int
get x env = case env x of
Just n -> n
Nothing -> -1
On Sat, Oct 18, 2014 at 8:08 AM, Keeley Abbott <[email protected]> wrote:
> Hi All,
>
> So, I am taking a Functional Programming class this fall, and I have
> struggling to understand how to build types and functions correctly. For
> some reason it just isn?t clicking. I have the following module I am
> working on, and I need some guidance.
>
> ? Variable names
> type Name = String
>
> ? An environment for looking up the value of a variable
> type Env = Name -> Maybe Int
>
> ? An empty environment
> empty :: Env
> empty env = Nothing
>
> ? Set a variable to a value in the environment if it doesn?t already exist
> set :: Name -> Int -> Env -> Env
> set x i e = \y -> if x == y then (Just i) else e y
>
> ? Lookup the value of a variable in the environment
> get :: Name -> Env -> Int
> get x env = ?? (I previously had ?type Env = Name -> Int?, so this was
> working with env x, but we had to change empty to be something other than
> just a runtime error, which is why I made Env = Name -> Maybe Int)
>
> ?Remove a variable from the environment
> unset :: Name -> Env -> Env
> unset x e = \y -> if x == y then empty x else env y
>
> At this point I don?t know how to fix get, so I get an int to display (it
> keeps telling me it can?t match the type ?Maybe Int? with the expected type
> ?Int?). And I don?t know where to go from there to create getOr, setAll,
> and mapEnv functions, because I am just not understanding what I am doing.
> For the most part I have been doing simpler things that I could just mess
> with the functions until they work, but even at that I?m not getting HOW
> they work? Any assistance or instruction on how I can GET what I am trying
> to do would be greatly appreciated.
>
> Thanks,
> Kallarhynn
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141018/6fba5878/attachment-0001.html>
------------------------------
Message: 6
Date: Sat, 18 Oct 2014 20:09:53 +0100
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] latest Haskell Platform build fails
Message-ID:
<caeieuu+itowto0jepedfvgys+pukwqf+evrgpfctktv0rot...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Lurker speaks: I too came to the same conclusion as Michael a long time
back; I absolutely love Haskell but sooner or later it seemed to me that
the "dependancy hell" would kick in just when you least needed / expected
it to. It is the single biggest put off for me now to consider using it.
I too find myself back in Erlang and Prolog these days, and I have begun
learning OCaml instead as it offers a lot of things that Haskell seems but
without the pure functional venus flytraps of monads, state transformers
etc etc.
Not all jobbing developers are math majors or CS majors, some of us are
just mere mortals wishing to use shinier tools for a safer and more
rigorous path to freedom from day job hell!
But, SPJ et al.... f* awesome language!
:)
Sean
On 18 October 2014 13:16, Michael Martin <[email protected]> wrote:
>
> On 10/18/2014 02:31 AM, Heinrich Apfelmus wrote:
>
>> Michael L Martin wrote:
>>
>>> On 10/16/2014 03:11 PM, Mateusz Kowalczyk wrote:
>>>
>>>> Merely going from the error message and your steps, it seems to me that
>>>> you're *not* meant to install GHC yourself first and that the platform
>>>> ships with GHC. I would say try again but without installing GHC and
>>>> cabal first.
>>>>
>>>>
>>>> Well, that didn't work, either:
>>>
>>> mmartin@cloud:~/Downloads/haskell-platform-2014.2.0.0$ ./platform.sh
>>> .../ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
>>> ../platform.sh: 18: ./platform.sh: cabal: not found
>>> ***
>>> *** Building hptool
>>> ***
>>> ../platform.sh: 29: ./platform.sh: cabal: not found
>>> mmartin@cloud:~/Downloads/haskell-platform-2014.2.0.0$
>>>
>>
>> Apparently, different distributions of the Haskell Platform differ in
>> what tools they package: the binary distribution includes GHC and cabal,
>> whereas the source distribution, which you are currently trying to install,
>> doesn't include GHC and cabal.
>>
>> Judging from the error message
>>
>> > Stderr:
>> > mtl-2.1.3.1: package(s) with this id already exist: mtl-2.1.3.1
>>
>> it seems that the platform tries to build the `mtl` package, but fails
>> because it is already installed. You can use the command
>>
>> $ ghc-pkg list
>>
>> to see which packages are installed globally and in your home directory.
>> Most likely, `mtl` got installed because you installed `cabal-install`. I
>> have no idea how to deal with the conflict, though, I'm not really familiar
>> with the Haskell platform source distribution.
>>
>>
>> Best regards,
>> Heinrich Apfelmus
>>
>> --
>> http://apfelmus.nfshost.com
>>
>> Thanks, Heinrich.
>
> I find it astonishing that build/install fails because it finds that a
> dependency that it needs is already
> installed. This is totally unreasonable. I was really looking forward to
> experimenting with Cloud Haskell,
> but the pain of installation, coupled with Haskell's well-known issues
> with "dependency hell", have
> soured me on Haskell. The language itself is amazing - I really like it.
> But I'm afraid that the dysfunctional
> nature of the Haskell ecosystem is driving me back to Erlang/OTP. OTP has
> proven to be industrial
> strength. I hope that someday (soon), Haskell will be able to claim that,
> as well.
>
>
>
> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141018/a4cb43d9/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 76, Issue 12
*****************************************