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:  RankNTypes + ConstraintKinds to use Either as a "union"
      (Kim-Ee Yeoh)
   2. Re:  RankNTypes + ConstraintKinds to use Either as a "union"
      (Thiago Negri)
   3. Re:  RankNTypes + ConstraintKinds to use Either as a "union"
      (Kim-Ee Yeoh)
   4. Re:  Javascript with Haskell (Patrick Mylund Nielsen)
   5. Re:  Error when starting GHCI (Arie van   Wingerden)
      (Howard B. Golden)


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

Message: 1
Date: Thu, 10 Oct 2013 01:59:36 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] RankNTypes + ConstraintKinds to use
        Either as a "union"
Message-ID:
        <CAPY+ZdQ7qcQQRoBUnVeFVpdcVQU8Pm=7kQp78ZGd=E=wzgd...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Thu, Oct 10, 2013 at 1:28 AM, Thiago Negri <[email protected]> wrote:

> foo :: (tc a, tc b) => (forall c. tc c => c -> c) -> Either a b -> Either
> a b


Aren't type classes supposed to be Capitalized?

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20131010/5a129e25/attachment-0001.html>

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

Message: 2
Date: Wed, 9 Oct 2013 16:24:49 -0300
From: Thiago Negri <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] RankNTypes + ConstraintKinds to use
        Either as a "union"
Message-ID:
        <cablneztlcnkp15jeanpmcihgwbdikgbgmfofr-h6quj+gnj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I want to use something like "type class variable".

Suppose I have a value of type "Either Int Double" and I want to double
it's content and get back the value wrapped back into that Either. I can
write a function that can work on all types that belongs to the Num class,
i.e. "Num a => a -> a". Both Int and Double are members of the Num class,
so I can apply this function to any of those.

Now replace the "Num" class to a variable, in my example "tc" (short for
"type class"), as long as the function I'm trying to apply rely only on
functions defined by the type class "tc" and both sides of Either belongs
to the class "tc", then I can apply that function to it.

That's what I'm trying to express.



2013/10/9 Kim-Ee Yeoh <[email protected]>

>
> On Thu, Oct 10, 2013 at 1:28 AM, Thiago Negri <[email protected]> wrote:
>
>> foo :: (tc a, tc b) => (forall c. tc c => c -> c) -> Either a b -> Either
>> a b
>
>
> Aren't type classes supposed to be Capitalized?
>
> -- Kim-Ee
>
> _______________________________________________
> 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/20131009/a09c508a/attachment-0001.html>

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

Message: 3
Date: Thu, 10 Oct 2013 03:08:17 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] RankNTypes + ConstraintKinds to use
        Either as a "union"
Message-ID:
        <capy+zdrjfaz7pygtpr9vf8yfk1c_aow3vz4hb5x+bjxogb5...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Thu, Oct 10, 2013 at 2:24 AM, Thiago Negri <[email protected]> wrote:

> I want to use something like "type class variable".


Right, my bad, I just noticed the ConstraintKinds.

One way of getting round this is:

> type F tc a b =  (tc a, tc b) => (forall c. tc c => c -> c) -> Either a b
-> Either a b
> foo' = (foo :: F Num a b) (2+)

As to why the type inference isn't powerful enough, you might want to ask
on cafe. It's really tricky to get it right. Too much power and it'll loop.
Too little and you end up with cases like this. And that's not even
considering bugs!

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20131010/5da392ec/attachment-0001.html>

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

Message: 4
Date: Wed, 9 Oct 2013 16:22:24 -0400
From: Patrick Mylund Nielsen <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Javascript with Haskell
Message-ID:
        <CAEw2jfymSidbVFRKXnw=aadk5jpi-azneepaa1m_wgjnecs...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Wed, Oct 9, 2013 at 9:50 AM, David McBride <[email protected]> wrote:

> There's actually some really good stuff for this now.  I have experimented
> a bit with haste.  Cabal install it, then use the haste-inst to install
> haskell libraries as javascript, then compile your program with it and then
> load it into your browser.  The only downside is that some lower level
> functions don't work, so  like I couldn't use the vector library in an
> application I had already written.  But if you keep that in mind while you
> are developing it works pretty well.  You should be able to do a text
> adventure no problem.
>
> There is also GHCJS which is set to release on the next ghc release (it
> only works with new versions of ghc) which promises to go even further to
> get those last few bits of code working.  But of course it isn't out just
> yet.
>
>
Not for nothing, but they have a Vagrant build that makes it really easy to
get up and running with GHCJS:
http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun


>
> On Tue, Oct 8, 2013 at 4:30 PM, Franco <[email protected]> wrote:
>
>> Hello mailing list,
>>
>>     I am developing a small text adventure game, which now runs nicely on
>> a
>> Linux terminal. I was going to ask a friend of mine to compile it on
>> Windows,
>> but then I thought: "Wouldn't it be awesome if people could run that in
>> their
>> browser?"
>>
>> I searched a bit and found this little example game [1]. As you can see it
>> was written in Haskell but you can play it in your browser.
>>
>> Now, to the problem: it seems to me that the code requires UHC (Utrecht
>> Haskell Compiler), which I don't have (I use GHC).
>> What are the alternatives (if any)? As stated above, I am not going to
>> code
>> anything complex graphic wise, so the simpler the merrier!
>> Thanks
>>
>> -F
>>
>>
>> [1] http://jshaskell.blogspot.de/2012/09/breakout.html
>> _______________________________________________
>> 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/20131009/0de91be7/attachment-0001.html>

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

Message: 5
Date: Wed, 9 Oct 2013 16:04:59 -0700 (PDT)
From: "Howard B. Golden" <[email protected]>
To: "[email protected]" <[email protected]>,
        "[email protected]" <[email protected]>
Subject: Re: [Haskell-beginners] Error when starting GHCI (Arie van
        Wingerden)
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Arie,


The only difference I have with your output on my computer is a line after the 
"Using binary package database..." line:

??? Using binary package database: 
C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.6.3\package.conf.d\package.cache


That package cache contains hs-dotnet-0.4.0.

I have no idea if this is why you are getting the error message at the end 
("Loading package base ... ").

Did you get any error messages when you installed the Haskell Platform?

Howard


________________________________
 From: Arie van Wingerden <[email protected]>
To: Howard B. Golden <[email protected]>; The Haskell-Beginners Mailing 
List - Discussion of primarily beginner-level topics related to Haskell 
<[email protected]> 
Sent: Wednesday, October 9, 2013 11:41 AM
Subject: Re: [Haskell-beginners] Error when starting GHCI (Arie van Wingerden)
 


Hi,
following Howards guidance I tried to start GHCI with the -v option and get:

GHCi, version 7.6.3: http://www.haskell.org/ghc/ ?:? for help
Glasgow Haskell Compiler, Version 7.6.3, stage 2 booted by GHC version 7.4.1
Using binary package database: C:\Program Files\Haskell Platform\2013.2.0.0\lib\
package.conf.d\package.cache
wired-in package ghc-prim mapped to ghc-prim-0.3.0.0-9d603ae4e062e1401099a3daa89
31d0f
wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-4093e6ff1e8ebdba04ec8
92df9ac108f
wired-in package base mapped to base-4.6.0.1-f0c2cc6dcf0e12bf75312a2e7f354095
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.8.0.0-42f1e6e5551
1ef4dff7e4249580faf8f
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
*** gcc:
"C:\Program Files\Haskell Platform\2013.2.0.0\lib/../mingw/bin/gcc.exe" "-fno-st
ack-protector" "-Wl,--hash-size=31" "-Wl,--reduce-memory-overheads" "-LC:\Progra
m Files\Haskell Platform\2013.2.0.0\lib\base-4.6.0.1" "--print-file-name" "wsock
32.dll"
*** gcc:
"C:\Program Files\Haskell Platform\2013.2.0.0\lib/../mingw/bin/gcc.exe" "-fno-st
ack-protector" "-Wl,--hash-size=31" "-Wl,--reduce-memory-overheads" "-LC:\Progra
m Files\Haskell Platform\2013.2.0.0\lib\base-4.6.0.1" "--print-file-name" "user3
2.dll"
*** gcc:
"C:\Program Files\Haskell Platform\2013.2.0.0\lib/../mingw/bin/gcc.exe" "-fno-st
ack-protector" "-Wl,--hash-size=31" "-Wl,--reduce-memory-overheads" "-LC:\Progra
m Files\Haskell Platform\2013.2.0.0\lib\base-4.6.0.1" "--print-file-name" "shell
32.dll"
Loading package base ... ghc.exe: : Kan opgegeven module niet vinden.
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
<command line>: can't load .so/.DLL for: ?(addDLL: could not load DLL)

Any ideas why this happens?
TIA,
? ?Arie



2013/10/8 Howard B. Golden <[email protected]>

Hi Arie,
>
>My guess is that you don't have a necessary library in your path. Here are the 
>Haskell libraries I have in my path (change as necessary for your setup):
>
>C:\Program Files\Haskell Platform\2013.2.0.0\lib\extralibs\bin
>C:\Program Files\Haskell Platform\2013.2.0.0\bin
>C:\Program Files\Haskell Platform\2013.2.0.0\mingw\bin
>
>HTH,
>
>Howard
>
>-------------------------
>Message: 2
>
>Date: Tue, 8 Oct 2013 18:12:41 +0200
>From: Arie van Wingerden <[email protected]>
>To: [email protected]
>Subject: [Haskell-beginners] Error when starting GHCI
>Message-ID:
>??? <CADkALSHpG7s89tT7rXJw56q7hkDyEcwv1=xu5tg3_qlqoqt...@mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi,
>
>today I downloaded the Haskell platform for 32 bits Windows
>(HaskellPlatform-2013.2.0.0-setup.exe) and installed it.
>
>The first time I started GHCI all worked perfectly.
>
>When I closed GHCI and later tried to start it again I constantly get
>however:
>C:\Users\Arie>ghci
>GHCi, version 7.6.3: http://www.haskell.org/ghc/??:? for help
>Loading package ghc-prim ... linking ... done.
>Loading package integer-gmp ... linking ... done.
>Loading package base ... ghc.exe: : Kan opgegeven module niet vinden.
><command line>: can't load .so/.DLL for:? (addDLL: could not load DLL)
>WHERE Kan opgegeven module niet vinden MEANS Can't find the specified module
>
>Any ideas?
>
>Kind regards,
>???Arie
>_______________________________________________
>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/20131009/d624c74f/attachment.html>

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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 64, Issue 16
*****************************************

Reply via email to