Re: [Haskell-cafe] Type error when trying to adapt http-proxy to new conduit

2012-12-27 Thread Michael Snoyman
On Thu, Dec 27, 2012 at 9:42 AM, Erik de Castro Lopo mle...@mega-nerd.comwrote: Pieter Laeremans wrote: Hi, The http-proxy package isn't compatible any longer with the latest conduit. Since it is open source, I thought, I might as well try to adapt it and submit a patch. Have you

[Haskell-cafe] Type error when trying to adapt http-proxy to new conduit

2012-12-26 Thread Pieter Laeremans
Hi, The http-proxy package isn't compatible any longer with the latest conduit. Since it is open source, I thought, I might as well try to adapt it and submit a patch. However I run into some difficulties. For example I get this type error when I'm trying to compile it :

Re: [Haskell-cafe] Type error when trying to adapt http-proxy to new conduit

2012-12-26 Thread Brandon Allbery
On Wed, Dec 26, 2012 at 6:22 PM, Pieter Laeremans pie...@laeremans.orgwrote: Network/HTTP/Proxy.hs:254:15: Couldn't match expected type `ResourceT IO (CIN.Pipe () () ByteString () (ResourceT IO) ())' with actual type `IO

Re: [Haskell-cafe] Type error when trying to adapt http-proxy to new conduit

2012-12-26 Thread Erik de Castro Lopo
Pieter Laeremans wrote: Hi, The http-proxy package isn't compatible any longer with the latest conduit. Since it is open source, I thought, I might as well try to adapt it and submit a patch. Have you looked int git? It currently compiles from git but there is a space leak that I haven't

Re: [Haskell-cafe] Type error with Type families

2012-09-18 Thread Marco Túlio Pimenta Gontijo
On Mon, Sep 17, 2012 at 6:27 PM, Alexander Solla alex.so...@gmail.com wrote: On Mon, Sep 17, 2012 at 10:59 AM, Ryan Ingram ryani.s...@gmail.com wrote: The problem is that the function 'element' is ambiguous, for the reasons MigMit pointed out. The standard solution to this problem is to

Re: [Haskell-cafe] Type error with Type families

2012-09-17 Thread Ryan Ingram
The problem is that the function 'element' is ambiguous, for the reasons MigMit pointed out. The standard solution to this problem is to add a dummy argument to fix the type argument to the type function: data Proxy a = Proxy class ... = ReplaceOneOf full where type Item full :: * --

Re: [Haskell-cafe] Type error with Type families

2012-09-17 Thread Alexander Solla
On Mon, Sep 17, 2012 at 10:59 AM, Ryan Ingram ryani.s...@gmail.com wrote: The problem is that the function 'element' is ambiguous, for the reasons MigMit pointed out. The standard solution to this problem is to add a dummy argument to fix the type argument to the type function: data Proxy

[Haskell-cafe] Type error with Type families

2012-09-16 Thread Marco Túlio Pimenta Gontijo
Hi. I cannot make this program type check: {-# LANGUAGE TypeFamilies, FlexibleContexts #-} import qualified Data.ListLike as LL class LL.ListLike full (Item full) = ReplaceOneOf full where type Item full :: * replaceOneOf :: [Item full] - full - full - full

Re: [Haskell-cafe] Type error with Type families

2012-09-16 Thread MigMit
It shoudn't typecheck. Suppose you have instances like instance ReplaceOneOf Foo where type Item Foo = Baz element = elementFoo instance ReplaceOneOf Bar where type Item Bar = Baz element = elementBar Now if you call replaceOneOf manyBazs foo1 foo2, Haskell should consult element ::

[Haskell-cafe] type error using ghc 6.10.1, not in previous versions

2009-01-12 Thread Tim Bauer
Hi all. Under I have some old code that broke under ghc 6.10.1. Under (6.6.1), 6.8.1 (and I think 6.8.2), this compiles. import Prelude hiding(catch) import Control.Concurrent import Control.Exception(catch,throw,evaluate) async :: IO a - IO (MVar a) async ioa = do mVar - newEmptyMVar

Re: [Haskell-cafe] type error using ghc 6.10.1, not in previous versions

2009-01-12 Thread Anish Muttreja
On Mon, Jan 12, 2009 at 07:14:36PM -0800, Tim Bauer wrote: Hi all. Under I have some old code that broke under ghc 6.10.1. Under (6.6.1), 6.8.1 (and I think 6.8.2), this compiles. import Prelude hiding(catch) import Control.Concurrent import Control.Exception(catch,throw,evaluate) async ::

Re: [Haskell-cafe] type error

2008-12-11 Thread Jason Dusek
You can disable the monomorphism restriction in your .ghci so it needn't trouble your interactive sessions further. My .ghci follows my signature. -- _jsn :set -XOverlappingInstances :set -XNoMonomorphismRestriction :set -XUnicodeSyntax :set -XArrows :set -Wall :set

Re: [Haskell-cafe] type error

2008-12-11 Thread Ryan Ingram
The other simple option is to eta-expand: let myprint x = print x will get the correct type, The monomorphism restriction is to stop things that look like *values* whose computation results are memoized, from turning into *functions* which need a dictionary context and get recomputed every time

[Haskell-cafe] type error

2008-12-10 Thread Cetin Sert
Hi, Why does this not function? Prelude sequence [print 'a', print 2] 'a' 2 [(),()] *Prelude let myprint = print* *Prelude sequence [myprint 'a', myprint 2]* interactive:1:18: Couldn't match expected type `()' against inferred type `Char' In the first argument of `myprint', namely 'a'

Re: [Haskell-cafe] type error

2008-12-10 Thread Janis Voigtlaender
Cetin Sert wrote: Hi, Why does this not function? Prelude sequence [print 'a', print 2] 'a' 2 [(),()] *Prelude let myprint = print* *Prelude sequence [myprint 'a', myprint 2]* interactive:1:18: Couldn't match expected type `()' against inferred type `Char' In the first argument of

[Haskell-cafe] Type error in final generator

2007-12-08 Thread Loganathan Lingappan
Hi, I am new to Haskell. I wrote the following code: module Main where import IO main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList processInputs = do putStrLn Enter a number: strNum - getLine let num

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Bryan O'Sullivan
Loganathan Lingappan wrote: main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList The type of main is understood to be IO (), so it can't return anything. You could work around this by rewriting the last line above as follows: print

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Derek Elkins
On Sat, 2007-12-08 at 16:39 -0800, Bryan O'Sullivan wrote: Loganathan Lingappan wrote: main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList The type of main is understood to be IO (), so it can't return anything. You could

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Loganathan Lingappan
Thanks Bryan and Derek. This works! Logo - Original Message From: Derek Elkins [EMAIL PROTECTED] To: Bryan O'Sullivan [EMAIL PROTECTED] Cc: Loganathan Lingappan [EMAIL PROTECTED]; haskell-cafe@haskell.org Sent: Saturday, December 8, 2007 4:53:54 PM Subject: Re: [Haskell-cafe] Type error

[Haskell-cafe] Type error with simple list function

2007-11-08 Thread Fernando Rodriguez
Hi, This simple function definition that should rotate a list (put the first item in the last place) fails with a rather cryptic error with ghc: f :: [a] -[a] -[a] f (w : ws) = ws : w Couldn't match expected type `[a] - [a]' against inferred type `[[a]]' In the expression: ws : w In the

Re: [Haskell-cafe] Type error with simple list function

2007-11-08 Thread Radosław Grzanka
2007/11/8, Fernando Rodriguez [EMAIL PROTECTED]: Hi, This simple function definition that should rotate a list (put the first item in the last place) fails with a rather cryptic error with ghc: f :: [a] -[a] -[a] f (w : ws) = ws : w Couldn't match expected type `[a] - [a]' against

RE: [Haskell-cafe] Type error with simple list function

2007-11-08 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of This simple function definition that should rotate a list (put the first item in the last place) fails with a rather cryptic error with ghc: f :: [a] -[a] -[a] f (w : ws) = ws : w Couldn't match expected type `[a] -

Re: [Haskell-cafe] Type error with simple list function

2007-11-08 Thread Alfonso Acosta
Hola Fernando, On Nov 8, 2007 1:52 PM, Bayley, Alistair [EMAIL PROTECTED] wrote: First, you've given a type sig which suggests that f takes two arguments (both lists of type [a]) and returns a list of type [a]. However, there is only one argument to f. A type sig that better matches your

[Haskell-cafe] Type error

2007-04-06 Thread Alfonso Acosta
Hi all, I have a type problem in my code which I dont know how to solve (and I'm not really sure why is caused). I have made a simplified example, can anyone have a look at it? Thanks in advance, The error is: Example.hs:24:47: Ambiguous type variable `a' in the constraint:

Re: [Haskell-cafe] Type error

2007-04-06 Thread Chris Kuklewicz
I'll explain a little bit. Consider (show (read 13)). The compiler has no way to know what the type a produced by read should be. It must be an instance of (Read a) and (Show a), but the compiler cannot generate any actual code! Alfonso Acosta wrote: Hi all, I have a type problem in my

Re: [Haskell-cafe] Type error

2007-04-06 Thread Alfonso Acosta
Thanks for your answer, The functional dependencies solution doesn't help because my instances cannot satisfy them (there are various DestPort and SourcePort instances with are required to support various HDSignals). I tried with existentials, but I'm still getting an error (I'm not that

Re[2]: [Haskell-cafe] Type error

2007-04-06 Thread Bulat Ziganshin
Hello Alfonso, Friday, April 6, 2007, 9:33:45 PM, you wrote: (I'm not that comfortable working with existentials yet :)). probably you may benefit from looking at http://haskell.org/haskellwiki/OOP_vs_type_classes and original Wadler's paper mentioned there -- Best regards, Bulat

Re: [Haskell-cafe] Type Error. Why!?

2006-11-22 Thread Henning Thielemann
On Wed, 22 Nov 2006, Neil Mitchell wrote: http://www.haskell.org/hawiki/MonomorphismRestriction Is there really not a page on the new wiki that explains that MR? We should also have a nice big FAQ, as this is often asked about. http://www.haskell.org/haskellwiki/Category:FAQ