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: Javascript with Haskell (Heinrich Apfelmus)
2. Re: Javascript with Haskell (David McBride)
3. Re: Error when starting GHCI (Arie van Wingerden)
(Arie van Wingerden)
4. RankNTypes + ConstraintKinds to use Either as a "union"
(Thiago Negri)
5. Re: Error when starting GHCI (Arie van Wingerden)
(Arie van Wingerden)
----------------------------------------------------------------------
Message: 1
Date: Wed, 09 Oct 2013 15:29:35 +0200
From: Heinrich Apfelmus <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Javascript with Haskell
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
Franco 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!
Well, a compiler like GHC turns Haskell code into machine code. You need
a different compiler if you want to target JavaScript: GHCJS, haste or
uhc are the currently available options.
I myself am currently working on a GUI library called threepenny-gui [1]
which uses the web browser as a display. However, while it does use the
browser, it is currently not meant to be used over the internet, only
locally. But maybe that would already be good enough for your purposes.
[1]: http://www.haskell.org/haskellwiki/Threepenny-gui
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
------------------------------
Message: 2
Date: Wed, 9 Oct 2013 09:50:18 -0400
From: David McBride <[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:
<CAN+Tr43hcw-mBYtbAZ3KLhNZ83zFtf4R=soem7n12vca+jd...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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.
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20131009/cdefea9b/attachment-0001.html>
------------------------------
Message: 3
Date: Wed, 9 Oct 2013 18:20:15 +0200
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]>
Subject: Re: [Haskell-beginners] Error when starting GHCI (Arie van
Wingerden)
Message-ID:
<CADkALSG5=lntj4ujuziwrwohsgyttgcvuynq1_b2xf23szz...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Howard,
the environment variables appear to be OK.
Furthermore I now have seen that it is a possible timing failure, because
one in many times I start GHCI it DOES start properly!
Very vague ...
Thanks for your help.
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/665ffafe/attachment-0001.html>
------------------------------
Message: 4
Date: Wed, 9 Oct 2013 15:28:26 -0300
From: Thiago Negri <[email protected]>
To: Haskell Beginners <[email protected]>
Subject: [Haskell-beginners] RankNTypes + ConstraintKinds to use
Either as a "union"
Message-ID:
<CABLneZthVpzf+eY1cFW+XMyvYgNje+57qZm80i9z5oyed3=t...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Is there a way to compile this code?
If not, why?
{-# LANGUAGE RankNTypes, ConstraintKinds #-}
-- This compiles
bar :: (Num a, Num b) => (forall c. Num c => c -> c) -> Either a b ->
Either a b
bar f (Left a) = Left (f a)
bar f (Right b) = Right (f b)
bar' = bar (+ 2)
-- This doesn't compile because foo' does not typecheck
foo :: (tc a, tc b) => (forall c. tc c => c -> c) -> Either a b -> Either a
b
foo f (Left a) = Left (f a)
foo f (Right b) = Right (f b)
foo' = foo (+ 2)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20131009/2d8002e6/attachment-0001.html>
------------------------------
Message: 5
Date: Wed, 9 Oct 2013 20:41:28 +0200
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]>
Subject: Re: [Haskell-beginners] Error when starting GHCI (Arie van
Wingerden)
Message-ID:
<cadkalsg3urt_xjocmhkxzkukj7p6jzgedrcuav92u6_5cuc...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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/d15e13bb/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 64, Issue 15
*****************************************