Send Beginners mailing list submissions to
[email protected]
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
[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: Haskell -> JavaScript -> nodejs
(Sumit Sahrawat, Maths & Computing, IIT (BHU))
2. Help - I'm completely lost with building a really simple app
with Snap and Groundhog (Matthias Beyer)
3. Re: Help - I'm completely lost with building a really simple
app with Snap and Groundhog (Peter Harpending)
4. Re: Help - I'm completely lost with building a really simple
app with Snap and Groundhog (Peter Harpending)
5. Re: Help - I'm completely lost with building a really simple
app with Snap and Groundhog ([email protected])
6. Reading binary data into numeric types (Barry DeZonia)
----------------------------------------------------------------------
Message: 1
Date: Sat, 20 Jun 2015 22:55:32 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
<[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>,
Haskell-cafe Cafe <[email protected]>
Subject: Re: [Haskell-beginners] Haskell -> JavaScript -> nodejs
Message-ID:
<cajbew8mmkf_ffhh3ycxyzt9afn7m5g74t+4k4iyg3gw81rx...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Better try on the cafe. cc-ing.
On 20 June 2015 at 15:26, Martin Vlk <[email protected]> wrote:
> I made some progress - in order for Haskell modules to work with ghcjs
> you need to use cabal with the --ghcjs flag to install them.
>
> Martin
>
> Martin Vlk:
> > Hi,
> > I can successfully compile a basic Hello World into JavaScript with
> > ghcjs and run it with nodejs.
> > But what I ultimately need to do is write a nodejs module in Haskell and
> > compile down to JavaScript with ghcjs. I need to be able to require
> > other nodejs modules as well.
> >
> > Could somebody point me in the right direction? E.g. what approach and
> > libraries to use...
> >
> > I have tried a simple thing with jsaddle/lens, but when I try to compile
> > with ghcjs it is not finding the imported modules, even though when
> > compiling with ghc it does find them (they are installed using cabal).
> >
> > Many Thanks
> > Martin
> >
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
--
Regards
Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150620/9f60cf59/attachment-0001.html>
------------------------------
Message: 2
Date: Sat, 20 Jun 2015 21:54:27 +0200
From: Matthias Beyer <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Help - I'm completely lost with building
a really simple app with Snap and Groundhog
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I am learning Haskell by trying to implement a really simple CRUD like
web app with Snap and Groundhog - and I'm completely lost, cannot get
it to work.
The relevant code is here:
https://github.com/matthiasbeyer/rate.hs/tree/restart_clean
What the app should be able to do:
- CRUD Categories, where a category can have several subcategories
or Ratings
- CRUD Ratings, where a rating has a title, a description and, of
course, a rating (something like a number from 0-10)
That's it. Backend should be postgresql, frontend should contain a
list of all categories with all ratings (a simple tree) and each
rating should have its own page where the description is listed.
So, I guess, this is not really complex or anything, but I'm
completely list with both integrating groundhog and heist, the former
beeing my current step.
Can someone digg into my code and tell me what I'm doing wrong? Or
maybe even provide a _good_ tutorial for me? Or even be my mentor for
this? Would be really nice!
Good night, Haskell community!
--
Mit freundlichen Gr??en,
Kind regards,
Matthias Beyer
Proudly sent with mutt.
Happily signed with gnupg.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150620/52f1ea02/attachment-0001.sig>
------------------------------
Message: 3
Date: Sat, 20 Jun 2015 17:50:49 -0600
From: Peter Harpending <[email protected]>
To: Matthias Beyer <[email protected]>, The Haskell-Beginners
Mailing List - Discussion of primarily beginner-level topics related
to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Help - I'm completely lost with
building a really simple app with Snap and Groundhog
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
On Sat, Jun 20, 2015 at 09:54:27PM +0200, Matthias Beyer wrote:
> I am learning Haskell by trying to implement a really simple CRUD like
> web app with Snap and Groundhog - and I'm completely lost, cannot get
> it to work.
Since you seem to know what all of those things are, I'm going to assume
you have some background in imperative programming. This assumption is
backed by your GitHub history.
I'm guessing, after the initial few languages, with most programming
languages you've encountered thus far, you can learn a new one in a week
or two.
Haskell isn't like other languages. It requires a fundamentally
different manner of thinking about your program. It's like learning to
program all over again. It is worth it, I promise.
As for learning Haskell, Chris Allen's tutorial has links to resources
covering everything under the sun:
<https://github.com/bitemyapp/learnhaskell>.
Now, regarding your actual question: what's wrong with the code you have
posted?
1. First of all, your dependencies are way too strict in your cabal
file. In fact, most of them conflict. I couldn't even run `cabal
install`.
If you want to make sure the packages play together nicely, you
should use Stackage <http://www.stackage.org>.
2. Nobody uses old versions of base anymore. You don't need that
old-base stuff.
3. Your cabal file needs a default-language field.
4. Snap is a bit labor-intensive. Yesod <http://www.yesodweb.com> is
much more well-suited for non-trivial web applications.
Once I cleaned up the cabal file, I was able to get the standard Hello,
World Snap application running on localhost.
I forked your repository on GitHub. You can see the changes I made here:
<https://github.com/matthiasbeyer/rate.hs/compare/master...pharpend:master>.
Note
that I am using GHC 7.10, which is the latest version. You might be on
an old version of GHC, in which case, you should do the following:
rm cabal.config
cabal install
cabal freeze
To run the application, I just used `cabal run`.
Peter Harpending
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150620/7033b4eb/attachment-0001.sig>
------------------------------
Message: 4
Date: Sat, 20 Jun 2015 17:53:24 -0600
From: Peter Harpending <[email protected]>
To: Matthias Beyer <[email protected]>, The Haskell-Beginners
Mailing List - Discussion of primarily beginner-level topics related
to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Help - I'm completely lost with
building a really simple app with Snap and Groundhog
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
And I just realized I based all of this off of what was in the master
branch. Oh well. See if it's helpful anyway.
Peter Harpending
On Sat, Jun 20, 2015 at 05:50:49PM -0600, Peter Harpending wrote:
> On Sat, Jun 20, 2015 at 09:54:27PM +0200, Matthias Beyer wrote:
> > I am learning Haskell by trying to implement a really simple CRUD like
> > web app with Snap and Groundhog - and I'm completely lost, cannot get
> > it to work.
>
> Since you seem to know what all of those things are, I'm going to assume
> you have some background in imperative programming. This assumption is
> backed by your GitHub history.
>
> I'm guessing, after the initial few languages, with most programming
> languages you've encountered thus far, you can learn a new one in a week
> or two.
>
> Haskell isn't like other languages. It requires a fundamentally
> different manner of thinking about your program. It's like learning to
> program all over again. It is worth it, I promise.
>
> As for learning Haskell, Chris Allen's tutorial has links to resources
> covering everything under the sun:
> <https://github.com/bitemyapp/learnhaskell>.
>
> Now, regarding your actual question: what's wrong with the code you have
> posted?
>
> 1. First of all, your dependencies are way too strict in your cabal
> file. In fact, most of them conflict. I couldn't even run `cabal
> install`.
>
> If you want to make sure the packages play together nicely, you
> should use Stackage <http://www.stackage.org>.
>
> 2. Nobody uses old versions of base anymore. You don't need that
> old-base stuff.
>
> 3. Your cabal file needs a default-language field.
>
> 4. Snap is a bit labor-intensive. Yesod <http://www.yesodweb.com> is
> much more well-suited for non-trivial web applications.
>
> Once I cleaned up the cabal file, I was able to get the standard Hello,
> World Snap application running on localhost.
>
> I forked your repository on GitHub. You can see the changes I made here:
> <https://github.com/matthiasbeyer/rate.hs/compare/master...pharpend:master>.
> Note
> that I am using GHC 7.10, which is the latest version. You might be on
> an old version of GHC, in which case, you should do the following:
>
> rm cabal.config
> cabal install
> cabal freeze
>
> To run the application, I just used `cabal run`.
>
> Peter Harpending
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150620/6af1036a/attachment-0001.sig>
------------------------------
Message: 5
Date: Sat, 20 Jun 2015 17:09:37 -0700
From: [email protected]
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Cc: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Help - I'm completely lost with
building a really simple app with Snap and Groundhog
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
El Jun 20, 2015, a las 16:50, Peter Harpending <[email protected]> escribi?:
> On Sat, Jun 20, 2015 at 09:54:27PM +0200, Matthias Beyer wrote:
>> I am learning Haskell by trying to implement a really simple CRUD like
>> web app with Snap and Groundhog - and I'm completely lost, cannot get
>> it to work.
>
> Since you seem to know what all of those things are, I'm going to assume
> you have some background in imperative programming. This assumption is
> backed by your GitHub history.
>
> I'm guessing, after the initial few languages, with most programming
> languages you've encountered thus far, you can learn a new one in a week
> or two.
>
> Haskell isn't like other languages. It requires a fundamentally
> different manner of thinking about your program. It's like learning to
> program all over again. It is worth it, I promise.
>
> As for learning Haskell, Chris Allen's tutorial has links to resources
> covering everything under the sun:
> <https://github.com/bitemyapp/learnhaskell>.
>
> Now, regarding your actual question: what's wrong with the code you have
> posted?
>
> 1. First of all, your dependencies are way too strict in your cabal
> file. In fact, most of them conflict. I couldn't even run `cabal
> install`.
>
> If you want to make sure the packages play together nicely, you
> should use Stackage <http://www.stackage.org>.
>
> 2. Nobody uses old versions of base anymore. You don't need that
> old-base stuff.
>
> 3. Your cabal file needs a default-language field.
>
> 4. Snap is a bit labor-intensive. Yesod <http://www.yesodweb.com> is
> much more well-suited for non-trivial web applications.
>
[[citation needed]]
Snap is used for lots of large production sites, and I don't think anyone would
claim it's more complex for a beginner.
Not starting a flamewar, just disputung that one is worse.
> Once I cleaned up the cabal file, I was able to get the standard Hello,
> World Snap application running on localhost.
>
> I forked your repository on GitHub. You can see the changes I made here:
> <https://github.com/matthiasbeyer/rate.hs/compare/master...pharpend:master>.
> Note
> that I am using GHC 7.10, which is the latest version. You might be on
> an old version of GHC, in which case, you should do the following:
>
> rm cabal.config
> cabal install
> cabal freeze
>
> To run the application, I just used `cabal run`.
>
> Peter Harpending
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
Message: 6
Date: Sat, 20 Jun 2015 20:29:30 -0500
From: Barry DeZonia <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Reading binary data into numeric types
Message-ID:
<cakcvfuqaato6up_zmktuntsk4agkpxzs+m1dpqovcwdxl1h...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hello,
I need to write some code that will read binary data from a file into
various types defined in Data.Int, Data.Word, and the floating types. I am
looking to make functions with signatures like Handle->IO Word16 and
Handle->IO Int32 and Handle->IO Float and others similarly defined. One
complication I am running into is that the data is stored in big endian
byte order. So my functions need to be flexible with byte ordering (and I
need to determine the endian ordering of the current platform). Anyhow I'm
pretty much a newbie and don't know how to do this. For a float in an
imperitive language I might read 4 bytes, possibly reorder them based on
platform endian value, and interpret the bytes as a float via a ptr. Would
the process be similar in Haskell? Pointers appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150620/a3eb17f9/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 84, Issue 34
*****************************************