Haskell responses for Eric Warmenhoven

Eric Warmenhoven asked a couple of Haskell questions. Here are my answers.

BTW, do you want to be added to Planet Haskell? If so, drop me an email.

Also, be sure to subscribe to the Haskell mailing lists.

Where did all the shared libraries go? Turning a Haskell module into a static library looks like it’s fairly straightforward, but it looks like it’s impossible to create a shared library that’s usable by other Haskell programs.

See the GHC FAQ.

Why do header files have a bizzare suffix? If module A uses something from module B and module B uses something from module A, there’s a circular dependency that GHC can’t resolve on its own. The solution to this is to create a “boot” copy of module A that defines the things that B depends on without depending on B. In C this is called a header file. In GHC this is called a boot file and is given the extension “.hs-boot”.

There are no header files with Haskell. Or rather, there are (the .hi files), but they are generated by the compiler when compiling the module. The .hs-boot files are not header files but a workaround for GHC’s inability to compile circularly dependent modules (which the language spec requires).

Why does everyone ignore all the practical stuff? I read through five tutorials before I finally found one (on Monads, of all things) that actually had a usable getArgs example.

Perhaps many people consider the practicals easy and want to discuss the hard things instead.

Where’s the Debian-specific documentation? For example, there’s a GTK module. Where is that? How do I get it? Is there a package for it? If not, how do I make one? (I saw the debian haskell mailing list but didn’t feel like wading through the archives hoping that one of my questions might be answered.)

There is no Debian-specific documentation apart from a draft “policy”.

Googling, I found this repository that contains Gtk2HS debs. Haven’t tried them, though.

6 thoughts on “Haskell responses for Eric Warmenhoven

  1. Perhaps many people consider the practicals easy and want to discuss the hard things instead.

    Typical elitist answer from a functional programming advocate. Why do all the developers using functional languages have a superiority complex?

  2. Compared to a lot of things Haskell, getArgs is easy. Once you figure out how to call functions and how to deal with the IO monad, you should be able to handle getArgs without examples. (This assumes prior programming experience, but most Haskell tutorials are not aimed for the novice programmer.)

  3. I’m taking care of the Gtk2Hs Debian packages. It will end up in Debian proper soon enough. (It’s a pending upload.) The repository mentioned above will always have the latest/experimental revision(s).

  4. I have a problem with Haskell which i can’t solve. If you help me, I will be happy.
    Two lists is sent as parameter to a function. If second list contains first list, return true, else return false. This comparision must be in order of first list. You can look at examples.

    function type as follows:
    sublist:: [a] -> [a] -> Bool


    For instance [2,4,5] list is sub list of [3,7,2,4,5,9] list but not of [3,7,4,2,5,9] list.

    sublist [2,8] [1,5,6,2,4,7,8,2]
    sublist [1,2,3] [0,1,2,3,4,5,6]
    sublist [5,4] [1,4,5,7,8,3,5,4]
    sublist [1,2,4,3,4,5,7,8,9,5] [8,2,3,1,2,4,3,4,5,7,8,9,5,1,6,2]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.