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
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 :
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
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
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
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 :: *
--
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
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
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 ::
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
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 ::
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
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
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'
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
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
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
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
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
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
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
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] -
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
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:
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
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
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
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
28 matches
Mail list logo