Re: [Haskell-cafe] ghc-mtl, hint, mueval for ghc-7.6 ?

2012-10-08 Thread Daniel Gorín
Hi Johannes, The repository version of ghc-mtl already compiles with ghc 7.6.1. I'm working at the moment on making hint compile again as well (am I the only one on this list that doesn't get excited with every new release of ghc? :)), then I'll upload both to hackage. Thanks, Daniel On Oct

Re: [Haskell-cafe] hint and type synonyms

2012-04-01 Thread Daniel Gorín
in a library (and make sure that it is installed before running the program). Hope this helps... Daniel On Mar 31, 2012, at 8:06 PM, Claude Heiland-Allen wrote: Hi Daniel, cafe, On 31/03/12 17:47, Daniel Gorín wrote: Could you provide a short example of the code you'd like to write

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Daniel Gorín
On Sep 14, 2011, at 5:29 AM, Kazu Yamamoto (山本和彦) wrote: Hello, Of course, I use ByteString or Text for real programming. But I would like to know whether or not there are any efficient methods to remove a tail part of a list. --Kazu In that case, I would prefer this version, since it

Re: [Haskell-cafe] ghc-mtl and ghc-7.2.1

2011-09-07 Thread Daniel Gorín
Hi Romildo, you can try the darcs version of ghc-mtl [1], I don't know if that will be enough to build lambdabot, though Best, Daniel [1] http://darcsden.com/jcpetruzza/ghc-mtl On Sep 7, 2011, at 1:34 PM, José Romildo Malaquias wrote: Hello. In order to compile ghc-mtl-1.0.1.0 (the latest

Re: [Haskell-cafe] External system connections

2011-07-11 Thread Daniel Gorín
On Jul 11, 2011, at 10:48 PM, Alistair Bayley wrote: 12 July 2011 05:49, Michael Snoyman mich...@snoyman.com wrote: As for Bryan's resource-pool: currently I would strongly recommend *against* using it for any purpose. It is based on MonadCatchIO-transformers[2], which is a subtly broken

Re: [Haskell-cafe] generic putback

2011-05-15 Thread Daniel Gorín
I think you need to change the type of putback slightly: import Data.IORef putback :: a - IO a - IO (IO a) putback a action = do next - newIORef a return (do r - readIORef next; writeIORef next = action; return r) main = do getChar' - putback 'a' getChar str - sequence $ take

Re: [Haskell-cafe] Re: All binary strings of a given length

2010-10-15 Thread Daniel Gorín
I expect this one to run in constant space: import Data.Bits genbin :: Int - [String] genbin n = map (showFixed n) [0..2^n-1::Int] where showFixed n i = map (bool '1' '0' . testBit i) [n-1,n-2..0] bool t f b = if b then t else f Daniel On Oct 15, 2010, at 9:43 AM, Eugene

Re: [Haskell-cafe] ghc api printing of types

2010-07-04 Thread Daniel Gorín
I believe the way is done in hint is something like this (untested): showType t = do -- Unqualify necessary types -- (i.e., do not expose internals) unqual - GHC.getPrintUnqual return $ GHC.showSDocForUser unqual (GHC.pprTypeForUser False t) -- False means 'drop explicit

Re: [Haskell-cafe] Using Hint with a socket server

2010-06-17 Thread Daniel Gorín
Hi Tom, There is probably more than one way to do this. Did you try using the package hint-server? [1] It has a very simple interface: you start a server and obtain a handle; then you can run an interpreter action using the handle. Something like this: runIn handle (interpret msg (as

Re: [Haskell-cafe] How efficient is read?

2010-05-08 Thread Daniel Gorín
On May 9, 2010, at 12:32 AM, Tom Hawkins wrote: I have a lot of structured data in a program written in a different language, which I would like to read in and analyze with Haskell. And I'm free to format this data in any shape or form from the other language. Could I define a Haskell type for

Re: [Haskell-cafe] Hint causes GHCi linker error under Windows

2009-12-12 Thread Daniel Gorín
Hi, Martin Do you have a complete example one can use to reproduce this behavior? (preferably a short one! :P) In any case, I'm resending your message to the glasgow-haskell-users list to see if a ghc guru recognize the error message. It is strange that the problem only manifests on

Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-11-11 Thread Daniel Gorín
On Nov 11, 2009, at 5:39 AM, Martin Hofmann wrote: I still have problems and your code won't typecheck on my machine printing the following error: [...] I assume we are using different versions of some packages. Could you please send me the output of your 'ghc-pkg list'. Thanks, Martin

Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-11-10 Thread Daniel Gorín
On Sep 30, 2009, at 2:20 AM, Martin Hofmann wrote: Thanks a lot. You ought to be able to add a Control.Monad.CatchIO.catch clause to your interpreter to catch this kind of errors, if you want. I forgot to mention that this didn't work for me either. Thanks for the report! You are

Re: [Haskell-cafe] Problems with Language.Haskell.Interpreter and errors

2009-09-29 Thread Daniel Gorín
On Sep 29, 2009, at 8:56 AM, Martin Hofmann wrote: Hi, The API of Language.Haskell.Interpreter says, that 'runInterpreter' runInterpreter :: (MonadCatchIO m, Functor m) = InterpreterT m a - m (Either InterpreterError a) returns 'Left' in case of errors and 'GhcExceptions from

Re: [Haskell-cafe] .hi inconsistency bug.

2009-03-18 Thread Daniel Gorín
should be done testing the solution before I hit the send button... Cabal guys, you rock. Thanks again, Dan. /Joe Daniel Gorín wrote: Hi Just a wild guess but maybe the interpreter is recompiling (in runtime) code that has already been compiled to build your application (in compile-time

Re: [Haskell-cafe] .hi inconsistency bug.

2009-03-17 Thread Daniel Gorín
Hi Just a wild guess but maybe the interpreter is recompiling (in runtime) code that has already been compiled to build your application (in compile-time). This may lead to inconsistencies since a type such as HackMail.Data.Main.Types.Filter may refer to two different (and incompatible)

Re: [Haskell-cafe] .hi inconsistency bug.

2009-03-17 Thread Daniel Gorín
Hi Just a wild guess but maybe the interpreter is recompiling (in runtime) code that has already been compiled to build your application (in compile-time). This may lead to inconsistencies since a type such as HackMail.Data.Main.Types.Filter may refer to two different (and incompatible)

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-06 Thread Daniel Gorín
to use it, I need to not know it... Perhaps, in fact, I'm doing this wrong. Thanks for the help Daniel, everyone... /Joe Daniel Gorín wrote: Ok, so I've pulled the latest version and the error I get now is: Hackmain.hs:70:43: Ambiguous type variable `a' in the constraint

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Daniel Gorín
Hi I've downloaded Hackmain from patch-tag, but I'm getting a different error. The error I get is: Hackmain.hs:63:10: No instance for (Data.Typeable.Typeable2 Control.Monad.Reader.Reader) arising from a use of `interpret' at Hackmain.hs:63:10-67 Hint

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Daniel Gorín
instances in all the appropriate places. And provided a (maybe incorrect? Though I'm fairly sure that shouldn't affect the bug I'm having now) Typeable implementation for Reader, but I still get this ambiguous type. I'll push the current version asap. Thanks. /Joe Daniel Gorín wrote: Hi

Re: [Haskell-cafe] Newtype deriving with functional dependencies

2009-02-01 Thread Daniel Gorín
On Feb 2, 2009, at 1:06 AM, Louis Wasserman wrote: Is there any sensible way to make newtype FooT m e = FooT (StateT Bar m e) deriving (MonadState) work to give instance MonadState Bar (FooT m e)? That is, I'm asking if there would be a semantically sensible way of modifying

Re: [Haskell-cafe] propogation of Error

2008-12-05 Thread Daniel Gorín
i would expect to get back the Error from the *first* function in the sequence of functions in checkHeader (oggHeaderError from the oggHeader function). but instead i always see the Error from the *last* function in the sequence, OggPacketFlagError from the OggPacketFlag function. why is

Re: [Haskell-cafe] using ghc as a library

2008-10-26 Thread Daniel Gorín
On Oct 25, 2008, at 8:39 PM, Anatoly Yakovenko wrote: so I am trying to figure out how to use ghc as a library. following this example, http://www.haskell.org/haskellwiki/GHC/As_a_library, i can load a module and examine its symbols: [...] given Test.hs: module Test where hello = hello

Re: [Haskell-cafe] Haskell's type system

2008-06-18 Thread Daniel Gorín
On Jun 17, 2008, at 11:08 PM, Don Stewart wrote: Haskell's type system is based on System F, the polymorphic lambda calculus. By the Curry-Howard isomorphism, this corresponds to second-order logic. just nitpicking a little this should read second-order propositional logic, right?

Re: [Haskell-cafe] hint / ghc api and reloading modules

2008-05-31 Thread Daniel Gorín
(Since this can be of interest to those using the ghc-api I'm cc-ing the ghc users' list.) Hi, Evan The odd behavior you spotted happens only with hint under ghc-6.8. It turns out the problem was in the session initialization. Since ghc-6.8 the newSession function no longer receives a

Re: [Haskell-cafe] Problem with Python AST

2008-02-20 Thread Daniel Gorín
Hi Something like this would do? if_ = Compound $ If [(IntLit 6, Suite [] [Break])] Nothing while_ = Compound $ While (IntLit 6) (Suite [] [if_]) Nothing f = Program [while_] -- this one fails -- f2 = Program [if_] newtype Ident = Id String data BinOp = Add | Sub data Exp =