Re: [Haskell-cafe] type families and type signatures

2008-04-10 Thread Lennart Augustsson
On Thu, Apr 10, 2008 at 4:20 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: the five signatures forall a. S a forall b. S b forall a b. S (a, b) Int S Int By alpha-convertible I mean the usual thing from lambda calculus, they are identical modulo the names of bound variables.

Re: [Haskell-cafe] type families and type signatures

2008-04-10 Thread Lennart Augustsson
I didn't say TF was the only broken feature in GHC. But I want to see the broken ones removed, instead of new ones added. :) In the current GHC there are even definitions that are perfecty usable, that cannot be given the type signature that that was inferred. At work we have the warning for

Re: [Haskell-cafe] type families and type signatures

2008-04-10 Thread Lennart Augustsson
On Thu, Apr 10, 2008 at 4:20 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: Lennart Augustsson: On Wed, Apr 9, 2008 at 8:53 AM, Martin Sulzmann [EMAIL PROTECTED] wrote: Lennart, you said (It's also pretty easy to fix the problem.) What do you mean? Easy to fix the type

Re: [Haskell-cafe] type families and type signatures

2008-04-10 Thread Claus Reinke
To make it legal: If foo' with a type signature doesn't type check, try to infer a type without a signature. If this succeeds then check that the type that was inferred is alpha-convertible to the original signature. If it is, accept foo'; the signature doesn't add any information.

[Haskell-cafe] PhD or PostDoc opening in Dresden, Germany

2008-04-10 Thread Janis Voigtlaender
There is a research position on offer in the project described at: http://wwwtcs.inf.tu-dresden.de/~voigt/project/ The official job advertisement (in German) can be found at: http://www.verw.tu-dresden.de/StellAus/einzelstelle.asp?id=783 The most important details are: - full-time

[Haskell-cafe] Haskell library install question

2008-04-10 Thread Galchin, Vasili
Hello, I have configured, built and installed a library. When I runhaskell Setup.hs install, I noticed the message Registering unix-2.2.0.0... In what sense is it being registered? Can I query this registry information? Thanks, Vasili ___

Re: [Haskell-cafe] Haskell library install question

2008-04-10 Thread Bulat Ziganshin
Hello Vasili, Thursday, April 10, 2008, 6:12:45 PM, you wrote: Registering unix-2.2.0.0... In what sense is it being registered? Can I query this registry information? ghc-pkg -- Best regards, Bulatmailto:[EMAIL PROTECTED]

[Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Adam Smyczek
For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype RBAction a = RBAction { exec :: ErrorT String (StateT RBState BrowserAction) a } deriving (Functor, Monad, MonadState RBState)

[Haskell-cafe] ghc

2008-04-10 Thread Cetin Sert
Hi, Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! By the way there is no computer in the 4 or so networks I have online access to on which ghc is not installed, which might be a sign people like

Re: [Haskell-cafe] Control.Parallel.Strategies

2008-04-10 Thread Sebastian Sylvan
On Wed, Apr 9, 2008 at 11:10 PM, Justin Bailey [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 3:03 PM, Sebastian Sylvan [EMAIL PROTECTED] wrote: Hmm, that's curious. I compile with ghc --make -threaded partest.hs -o par.exe, and then run it with par.exe +RTS -N2 -RTS. Am I making some

Re: [Haskell-cafe] Haskell library install question

2008-04-10 Thread Galchin, Vasili
Thanks, Bulat. On Thu, Apr 10, 2008 at 9:18 AM, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Vasili, Thursday, April 10, 2008, 6:12:45 PM, you wrote: Registering unix-2.2.0.0... In what sense is it being registered? Can I query this registry information? ghc-pkg -- Best regards,

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Ryan Ingram
Assuming you have ioAction :: IO x - BrowserAction x (from http://homepages.paradise.net.nz/warrickg/haskell/http/#browser) you can do: instance MonadIO BrowserAction where liftIO = ioAction Then you can derive MonadIO with GHC's newtype deriving. Alternatively, you can implement it directly

[Haskell-cafe] Longest increasing subsequence

2008-04-10 Thread Matt Amos
I'm trying to break out of my imperative mind-set by learning Haskell in small snippets. After a few successes I've hit a bit of a roadblock with one of the classic dynamic programming problems, the longest increasing subsequence: http://en.wikipedia.org/wiki/Longest_increasing_subsequence

Re: [Haskell-cafe] instance Monad m = Functor m

2008-04-10 Thread Hans Aberg
On 9 Apr 2008, at 17:49, Henning Thielemann wrote: Additionally I see the problem, that we put more interpretation into standard symbols by convention. Programming is not only about the most general formulation of an algorithm but also about error detection. E.g. you cannot compare complex

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Antoine Latter
On Thu, Apr 10, 2008 at 9:50 AM, Adam Smyczek [EMAIL PROTECTED] wrote: For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype RBAction a = RBAction { exec :: ErrorT String (StateT

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Antoine Latter
On Thu, Apr 10, 2008 at 12:44 PM, Antoine Latter [EMAIL PROTECTED] wrote: {-# LANGUAGE GeneralizedNewtypeDeriving #-} import Control.Monad.Trans import Control.Monad.State import Control.Monad.Error type BrowserAction = IO -- or something else which is in MondaIO data RBState =

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Judah Jacobson
On Thu, Apr 10, 2008 at 7:50 AM, Adam Smyczek [EMAIL PROTECTED] wrote: For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype RBAction a = RBAction { exec :: ErrorT String (StateT

Re: [Haskell-cafe] ghc

2008-04-10 Thread Philip Weaver
2008/4/10 Cetin Sert [EMAIL PROTECTED]: Hi, Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! If I parse your question correctly, the answer is no, you do not need GHC installed to run the

Re: [Haskell-cafe] ghc

2008-04-10 Thread Brent Yorgey
Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! Nope! As long as they're compiled for the right architecture, GHC-produced binaries should run anywhere, whether GHC is there or not. This is

Re: [Haskell-cafe] ghc

2008-04-10 Thread Brandon S. Allbery KF8NH
On Apr 10, 2008, at 12:27 , Cetin Sert wrote: Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! ghc doesn't currently create shared objects, so no. -- brandon s. allbery

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Adam Smyczek
Thanks a lot for all explanations! It looks like 'ioAction' is the key to the solution and if the Browser module did not provide/expose this function, no IO actions could be run inside the BrowserAction monad? If yes, is this a general concept/pattern how to hide functionality of a underlying

[Haskell-cafe] Re: ghc

2008-04-10 Thread Peter Hercek
Cetin Sert wrote: Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! No. Well possibly yes if you use GHC api (e.g. for compiling a haskel code from your haskell application) but for common

[Haskell-cafe] library version problem

2008-04-10 Thread Galchin, Vasili
Hello, I doing work using Linux. The wrong version (for me) of the unix package seems to be visible. I see possibilities to use ghc-pkg to suppress the unix package that I don't want(2.3.0.0) but that seems dangerious. Details are below . What should I do? Regards, vasili When I do:

Re: [Haskell-cafe] ghc

2008-04-10 Thread Ketil Malde
Cetin Sert [EMAIL PROTECTED] writes: Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! Quick answer: No. GHC produces normal, standalone binaries. You may have problems with dynamic libraries,

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Luke Palmer
On Thu, Apr 10, 2008 at 2:50 PM, Adam Smyczek [EMAIL PROTECTED] wrote: For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype RBAction a = RBAction { exec :: ErrorT String (StateT

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Tillmann Rendel
Adam Smyczek wrote: For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype RBAction a = RBAction { exec :: ErrorT String (StateT RBState BrowserAction) a } deriving (Functor, Monad,

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Adam Smyczek
On Apr 10, 2008, at 12:42 PM, Luke Palmer wrote: On Thu, Apr 10, 2008 at 2:50 PM, Adam Smyczek [EMAIL PROTECTED] wrote: For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype

Re: [Haskell-cafe] Longest increasing subsequence

2008-04-10 Thread Ariel J. Birnbaum
The article mentioned in this thread addresses a similar problem: http://lambda-the-ultimate.org/classic/message8282.html The main idea is to start by expressing the straightforward, inefficient solution ,in this case something like: liss = maximumBy length . filter ascending . concat . map

Re: [Haskell-cafe] Longest increasing subsequence

2008-04-10 Thread Robert Dockins
On Thursday 10 April 2008 01:20:49 pm Matt Amos wrote: I'm trying to break out of my imperative mind-set by learning Haskell in small snippets. After a few successes I've hit a bit of a roadblock with one of the classic dynamic programming problems, the longest increasing subsequence:

Re: [Haskell-cafe] Pattern match failure

2008-04-10 Thread Ariel J. Birnbaum
I think you were having a similar problem in an earlier thread. Others have given answers, but I'll try to drive the point home further. In a pattern match like this: f a = case a of [Rule x y] - ... the pattern is *NOT* matched against each element of the list, but against the list as a

Re: [Haskell-cafe] Longest increasing subsequence

2008-04-10 Thread Jacques Carette
You can translate the following algorithm (written in Maple 11), which can be made purely functional. [For the cognoscenti: attributes are implemented in-place in Maple, but that is really just an instance of the Decorator pattern which can be just as easily implemented with a functional

Re: [Haskell-cafe] ghc

2008-04-10 Thread Neil Mitchell
Hi Is GHC required to be installed on the target OS I compile Haskell binaries for in order for these binaries to run? I need a quick answer on that! No. You can compile binaries on one machine and move them to a similar machine without recompilation. If you want to move binaries to a