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: Reading binary data into numeric types (Brandon Allbery)
2. Re: Help - I'm completely lost with building a really simple
app with Snap and Groundhog (Matthias Beyer)
----------------------------------------------------------------------
Message: 1
Date: Sat, 20 Jun 2015 21:32:43 -0400
From: Brandon Allbery <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Reading binary data into numeric
types
Message-ID:
<CAKFCL4XrOVXmGvPiUUZsBac=2y-j3zimwmftgokx3svdous...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Sat, Jun 20, 2015 at 9:29 PM, Barry DeZonia <[email protected]> wrote:
> 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
>
Hopefully you don't have some requirement to reinvent this wheel; the
binary package already provides it, including support for endianness.
http://hackage.haskell.org/package/binary
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150620/a3d85f24/attachment-0001.html>
------------------------------
Message: 2
Date: Sun, 21 Jun 2015 11:23:01 +0200
From: Matthias Beyer <[email protected]>
To: Peter Harpending <[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="iso-8859-1"
Hi,
thanks a lot for your reply. Answer is inline:
On 20-06-2015 17:53:24, Peter Harpending wrote:
> 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.
>
nvm, I'll read through it and apply onto my branch, thanks!
>
> 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.
There is no need to convince me! I already lost my soul to FP and Haskell! I
know the concept is completely different from what I've learned so far, and I
know I have to re-learn things, but I also know that it's worth it!
> >
> > As for learning Haskell, Chris Allen's tutorial has links to resources
> > covering everything under the sun:
> > <https://github.com/bitemyapp/learnhaskell>.
> >
Thanks for reminding me of this!
> > Now, regarding your actual question: what's wrong with the code you have
> > posted?
My problem was that I didn't get groundhog to be integrated in my web app. I
already solved this, as you can see here:
https://github.com/matthiasbeyer/rate.hs/tree/restart_clean
But still, I am not able to get my migrations running.
> >
> > 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`.
> >
Hm. I can run `cabal configure` without problems. I did not run `cabal install`,
though, as I'm on nixos and it won't work anyways!
> > If you want to make sure the packages play together nicely, you
> > should use Stackage <http://www.stackage.org>.
> >
I'm using the cabal packages from nixos (haskellngPackages set). I'm not sure
how to know whether they play nicely together or not...
> > 2. Nobody uses old versions of base anymore. You don't need that
> > old-base stuff.
Ok, will remove it. It is what `snap init` gave me, as far as I can remember!
> >
> > 3. Your cabal file needs a default-language field.
Will add that.
> >
> > 4. Snap is a bit labor-intensive. Yesod <http://www.yesodweb.com> is
> > much more well-suited for non-trivial web applications.
I won't switch to yesod. Yesod is far more complex as far as I can tell. It
might be well suited for the app I want to write after this one, which will be
much more complex, but I guess I will still stick with Snap as it is (IMHO)
easier to learn.
Maybe you can convince me here.
> >
> > 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:
I'm on GHC 7.10.1, thanks! NixOS ships the latest, thankfully! :-)
--
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/20150621/ac29aa09/attachment-0001.sig>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 84, Issue 35
*****************************************