On Wed, Dec 16, 2009 at 9:40 AM, hask...@kudling.de hask...@kudling.de wrote:
Hi,
i am not quite sure how to do this in the most elegant way:
I have some data structures:
data A = A Double
data B = B Double
data C = C Double
...
and i want to allow only a subset in another data
2. why depth and not size (= total number of constructors)?
That seems harder to generate terms compositionally. To create all
terms of depth n+1 you just glue together all terms of depth n, but to
create terms of size n+1 you need to glue 1 with n, 2 with n-1 etc.
So?
One would fear that
Hi,
I'm cc'ing the people behind smallcheck, who can give definitive answers.
1. why are the tuple constructors treated differently?
I'd expect depth (x,y) = succ $ max (depth x) (depth y)
but the succ is missing.
I think this was a design choice. Some people would consider:
data Foo = Foo
Lyndon Maydwell maydw...@gmail.com writes:
On Mon, Dec 7, 2009 at 2:43 PM, Colin Adams colinpaulad...@googlemail.com
wrote:
2009/12/7 drostin77 ml.nwgr...@gmail.com:
Hello Hopefully Helpful Haskell Community!
(I really wanted that to be alliteration... couldn't come up with an h word
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
View this message in context:
http://old.nabble.com/Hayoo-and-Hoogle-%28beginner-question%29-tp26669924p26674323.html
Sent from the Haskell - Haskell-Cafe
in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
--
View this message in context:
http://old.nabble.com/Hayoo-and-Hoogle-%28beginner-question%29-tp26669924p26674323
On Mon, Dec 7, 2009 at 10:24 AM, Lyndon Maydwell maydw...@gmail.com wrote:
I had heard that Hoogle actually compiled any type-signatures, where
as Hayoo just did a text comparison.
I'm not actually sure if this is true or not though.
If it is, it would mean that [q] - [r] - [(q,r)] would
in Hoogle, but not Hayoo.
Am I right about this?
Yes, we (in Hayoo!) only do text based stuff. Is is possbile to search for
signatures, but no generalization etc. is done at all. This is very primitive
in Hayoo! and I really suggest using Hoogle for type searches.
As for the question about
place, or if they are already
answered in detail somewhere that my Googling didn't find please feel free
to paste a link and tell me to search better next time!
--
View this message in context:
http://old.nabble.com/Hayoo-and-Hoogle-%28beginner-question%29-tp26669924p26669924.html
Sent from
Neil Mitchell ndmitch...@gmail.com writes:
but if you use Hayoo for some reason other than Hoogle not searching
all packages, I'd love to know.
Isn't it obvious? We all use Hayoo for the Web 2.0 interface! :p
/me is just kidding
--
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
referring to the Serial instances in
http://hackage.haskell.org/package/smallcheck :
the idea is that series d gives all objects of depth = d.
depth of a term from an algebraic data type
is the standard depth concept for trees
(maximum nesting of constructors = longest path from root to node)
. If these questions are in the wrong place, or if they are already
answered in detail somewhere that my Googling didn't find please feel
free
to paste a link and tell me to search better next time!
--
View this message in context:
http://old.nabble.com/Hayoo-and-Hoogle-%28beginner-question%29
me to search better next time!
--
View this message in context:
http://old.nabble.com/Hayoo-and-Hoogle-%28beginner-question%29-tp26669924p26669924.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe mailing
2009/12/7 drostin77 ml.nwgr...@gmail.com:
Hello Hopefully Helpful Haskell Community!
(I really wanted that to be alliteration... couldn't come up with an h word
for community)
House?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
'Hood?
On Mon, Dec 7, 2009 at 2:43 PM, Colin Adams
colinpaulad...@googlemail.com wrote:
2009/12/7 drostin77 ml.nwgr...@gmail.com:
Hello Hopefully Helpful Haskell Community!
(I really wanted that to be alliteration... couldn't come up with an h word
for community)
House?
Say I have the following module:
module A
( T(T)
, t
, val
)
where
data T = T { t :: Int }
val :: T
val = T 7
When I use A with the following imports, I don't expect this to work,
but it does:
import
On Tue, Dec 1, 2009 at 3:11 PM, Sean McLaughlin sean...@gmail.com wrote:
Say I have the following module:
module A
( T(T)
, t
, val
)
where
data T = T { t :: Int }
val :: T
val = T 7
When I use
It looks like it is specified and the intended behavior:
From the report, section 5.2:
An algebraic datatype T declared by a data or newtype declaration may
be named in one of three ways:
The form T names the type but not the constructors or field names. The
ability to export a type without
On Tue, Dec 01, 2009 at 05:11:42PM -0500, Sean McLaughlin wrote:
The problem is that I explicitly didn't export 't' as an element of T
(by not writing T(..)).
Am I just misunderstanding how exports work? I couldn't figure out
what the correct behavior should be by looking at the 98 report.
Hello,
I am writing a port to F# of some haskell standard libraries.
I would like to publish them under an open source license and mention the
origin of the initial code.
www.haskell.org is under the simple permissive license. Does this license
also cover the souce code available from that
Hello jean-christophe,
Monday, November 30, 2009, 11:43:00 AM, you wrote:
I am writing a port to F# of some haskell standard libraries.
www.haskell.org is under the simple permissive license. Does this
license also cover the souce code available from that site?
the license cover only Wiki
www.haskell.org is under the simple permissive license. Does this
license also cover the souce code available from that site?
the license cover only Wiki contents. std haskell libraries covered
by BSD3
license, for example as a part of bsd3-covered GHC distribution
And in fact the
On Mon, 2009-11-30 at 09:43 +0100, jean-christophe mincke wrote:
Hello,
I am writing a port to F# of some haskell standard libraries.
I would like to publish them under an open source license and mention
the origin of the initial code.
www.haskell.org is under the simple permissive
Hello Malcolm,
Monday, November 30, 2009, 1:45:29 PM, you wrote:
And in fact the official Haskell'98 libraries are covered by an even
more permissive license: that of the Language Report.
The authors intend this Report to belong to the entire Haskell
community, and so we grant permission
i don't think that reproducing in its entirety is more permissive
for his purpose :)
I think translating to F# counts as modification, so the other clause
of the license applies; namely you can do anything you like with it,
provided you do not claim it defines Haskell'98.
Regards,
Valery V. Vorotyntsev wrote:
The following pattern appears quite often in my code:
results - map someConversion `liftM` replicateM nbytes Iter.head
The meaning is: take `nbytes' from stream, apply `someConversion' to
every byte and return the list of `results'.
But there's more than one
On Thu, Nov 26, 2009 at 10:17 AM, o...@okmij.org wrote:
You are correct: i2 and i3 can process a chunk of elements at a time,
if an enumerator supplies it. That means an iteratee like i2 or i3 can
do more work per invocation -- which is always good. Since you have to
get the results as a
On Fri, Nov 27, 2009 at 4:04 AM, John Lato jwl...@gmail.com wrote:
My apologies for not replying; I have been traveling and am only now
working through my email.
Oleg's response is much better than anything I would have written.
I'd like to add one point.
stream2list is very inefficient as
Hi all,
I've come across some code I just can't figure out how to write
appropriately. Below is a silly example that demonstrates what I'm trying to
do. I don't really have the appropriate vocabulary to describe the issue, so
I'll let the code speak for itself. In particular, I'm trying to
Am Sonntag 22 November 2009 19:24:48 schrieb Michael Snoyman:
Hi all,
I've come across some code I just can't figure out how to write
appropriately. Below is a silly example that demonstrates what I'm trying
to do. I don't really have the appropriate vocabulary to describe the
issue, so I'll
I am writing a binary data parser and use `iteratee' package.
The following pattern appears quite often in my code:
results - map someConversion `liftM` replicateM nbytes Iter.head
The meaning is: take `nbytes' from stream, apply `someConversion' to
every byte and return the list of `results'.
],[3,4,5],[6,7]]
--
[[1,3,6],[1,3,7],[1,4,6],[1,4,7],[1,5,6],[1,5,7],[2,3,6],[2,3,7],[2,4,6],[2,4,7],[2,5,6],[2,5,7]]
This is ugly!
Anyway, just forget the fact that these funstions do not do a check on the
length of the input list for a moment. My question is, how can I generalize
this function
on the
length of the input list for a moment. My question is, how can I generalize
this function to accept a list of lists of arbitrary length, and produce the
required result.
I hope I managed to make my point clear enough. Waiting for suggestions.
Regards,
--
Ozgur Akgun
Ozgur Akgun wrote:
Anyway, just forget the fact that these funstions do not do a check on
the length of the input list for a moment. My question is, how can I
generalize this function to accept a list of lists of arbitrary
length, and produce the required result.
Hi,
The concise solution
,
I'll definitely have a look at the implementation of sequence.
Cheers!
2009/11/19 Neil Brown nc...@kent.ac.uk
Ozgur Akgun wrote:
Anyway, just forget the fact that these funstions do not do a check on the
length of the input list for a moment. My question is, how can I generalize
Ozgur Akgun wrote:
Anyway, just forget the fact that these funstions do not do a check on the
length of the input list for a moment. My question is, how can I generalize
this function to accept a list of lists of arbitrary length, and produce
the
required result.
Hi,
The concise
question is, how can I
generalize
this function to accept a list of lists of arbitrary length, and
produce the
required result.
Hi,
The concise solution is the list monad, as already posted. If that
confuses you, here is a version using list comprehensions (well,
mostly
Hello,
On Nov 13, 2009, at 11:54 PM, Niklas Broberg wrote:
But the problem at hand here is auto-generated AST code, where we
cannot rely on the parser to do the right thing. There's help in the
AST such that it's possible to explicitly insert brackets where
needed, but I agree with Dominic
Niklas Broberg niklas.broberg at gmail.com writes:
please? http://trac.haskell.org/haskell-src-exts
Niklas, I'd love to raise a bug for it but unfortunately I can't log on to
trac. I don't understand why but none of my colleagues can log on either. It's
been a long standing issue. I presume
Dominic Steinitz dominic at steinitz.org writes:
Niklas Broberg niklas.broberg at gmail.com writes:
please? http://trac.haskell.org/haskell-src-exts
Niklas, I'd love to raise a bug for it but unfortunately I can't log on to
Good news. Although I couldn't logon as guest, I've created an
Hi
Adding brackets that MUST have been there, by default, sounds like a
great idea. The alternative is getting it wrong, so I think that's
very safe.
Adding brackets that MIGHT have been there is a lot less clear cut.
One important consideration is that the fixities you
parse/pretty-print with
Hi,
On Friday 13 November 2009 21:08:42 Neil Mitchell wrote:
In HLint I have a bracketing module, which has served me well. Please
take any ideas you need from it -
http://community.haskell.org/~ndm/darcs/hlint/src/HSE/Bracket.hs . In
particular, given a fully bracketed expression, I can call
Hi Daniel,
Funny, I did the opposite approach the other day (not saying either is better
:)); that is: parenthesize everything while building the AST (with a wrapper
for App) and then:
I have utilities in HLint for that too - but I don't want to remove
users brackets automatically :-)
Btw,
I've been generating Haskell using haskell-src-exts but the prettyprinter isn't
producing what I would expect.
I would expect parse . prettyPrint == id i.e. the AST should be unchanged if
you prettyprint it then parse it.
Here's an example generated expression:
App (App (Var (UnQual (Ident
Hi Dominic,
On Fri, Nov 13, 2009 at 9:49 AM, Dominic Steinitz domi...@steinitz.org wrote:
I would have expected the prettyprinter to produce this:
pay tPD (a (length tOD + -1))
Do I have to write my own prettyprinter? Do I have to put in explicit
parentheses? The latter seems unsatisfactory
Hi Niklas,
Do I have to write my own prettyprinter? Do I have to put in explicit
parentheses? The latter seems unsatisfactory as my generated AST is
unambiguous
and bracketing ought to be part of the prettyprinter. The former would be
quite
a lot of code as there are many cases to
On Fri, 2009-11-13 at 20:08 +, Neil Mitchell wrote:
Hi Niklas,
Do I have to write my own prettyprinter? Do I have to put in explicit
parentheses? The latter seems unsatisfactory as my generated AST is
unambiguous
and bracketing ought to be part of the prettyprinter. The former
Surely you do want this. It's the biggest problem with the original
haskell-src package, that it cannot print out any useful Haskell code
obtained from the parser, because it forgets all the brackets.
I should point out that haskell-src-exts already fixes this for code
obtained from the
On Fri, 2009-11-13 at 23:54 +0100, Niklas Broberg wrote:
Surely you do want this. It's the biggest problem with the original
haskell-src package, that it cannot print out any useful Haskell code
obtained from the parser, because it forgets all the brackets.
I should point out that
doing wrong?
Thanks.
--
View this message in context:
http://old.nabble.com/classes-question-tp26271257p26271257.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
:
http://old.nabble.com/classes-question-tp26271257p26271257.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com
.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
.
--
View this message in context:
http://old.nabble.com/classes-question-tp26271257p26271257.html
Sent from the Haskell - Haskell-Cafe mailing list archive at
Nabble.com.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman
I run : plus 2 3 I get this error:
ERROR - Unresolved overloading
*** Type : (Num a, PlusTimes a) = a
*** Expression : plus 2 3
What am I doing wrong?
Thanks.
--
View this message in context: http://old.nabble.com/classes-question-tp26271257p26271257.html
Sent from the Haskell - Haskell
- Unresolved overloading
*** Type : (Num a, PlusTimes a) = a
*** Expression : plus 2 3
What am I doing wrong?
Thanks.
--
View this message in context:
http://old.nabble.com/classes-question-tp26271257p26271257.html
Sent from the Haskell - Haskell-Cafe mailing list archive
/classes-question-tp26271257p26271257.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com
.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi,
I want to write a program that will take an AST and a cost vector that
represents a cost for each operation and produce a simplified version of the
tree based on cost reduction.
Can any one give me some ideas ?
Thanks
___
Haskell-Cafe mailing
Hello,
I've been thinking about a problem recently, and would like to know if
there are any recommendations for a solution.
I have two container-like type classes, defined as follows:
import Control.Monad
type family ElemOf c :: *
type family MonadOf c :: * - *
class PureContainer c where
OK, I understand that now but I've got a supplimentary question.
If I put:
instance Eq b = Eq (a - b) where
(==) = liftA2 (Prelude.==)
to do the Eq part I get another error:
Couldn't match expected type `Bool'
against inferred type `a - Bool'
In the expression: liftA2
, Nov 1, 2009 at 8:09 AM, b1g3ar5 nick.st...@gmail.com wrote:
OK, I understand that now but I've got a supplimentary question.
If I put:
instance Eq b = Eq (a - b) where
(==) = liftA2 (Prelude.==)
to do the Eq part I get another error:
Couldn't match expected type `Bool
On Sun, Nov 1, 2009 at 11:09 AM, b1g3ar5 nick.st...@gmail.com wrote:
OK, I understand that now but I've got a supplimentary question.
If I put:
instance Eq b = Eq (a - b) where
(==) = liftA2 (Prelude.==)
You don't need the Prelude. here.
to do the Eq part I get another error
I'm trying:
instance Num b = Num (a - b) where
fromInteger = pure . Prelude.fromInteger
negate = fmap Prelude.negate
(+) = liftA2 (Prelude.+)
(*) = liftA2 (Prelude.*)
abs = fmap Prelude.abs
signum = fmap Prelude.signum
but the compiler rejects it with:
src\Main.hs:24:9:
Could not deduce
On Sat, 31 Oct 2009, b1g3ar5 wrote:
I'm trying:
instance Num b = Num (a - b) where
fromInteger = pure . Prelude.fromInteger
negate = fmap Prelude.negate
(+) = liftA2 (Prelude.+)
(*) = liftA2 (Prelude.*)
abs = fmap Prelude.abs
signum = fmap Prelude.signum
but the compiler rejects it with:
For some reason, Show and Eq are superclasses of Num (despite Num not
actually using any of their methods), meaning that the compiler forces
you to write instances of Eq and Show before it even lets you write a
Num instance. I don't think anybody likes this, but I think we're
stuck with it for the
[1 of 1] Compiling Main ( sha1.lhs, interpreted )
import qualified Data.ByteString as B
main = B.getLine = B.putStrLn
Ok, modules loaded: Main.
*Main :main
*** Exception: no buffering
And just to make sure it's not something to do with GHCi or anything
like that
main =
Iain,
If you wanted to make sure it didn't have to do with ghci then you
should have compiled the original code, not tested different
functions. The code you provided works fine compiled and I too am
curious what is going on when you run it in ghci.
Thomas
On Tue, Oct 27, 2009 at 8:26 AM, Iain
Am Dienstag 27 Oktober 2009 16:47:12 schrieb Thomas DuBuisson:
Iain,
If you wanted to make sure it didn't have to do with ghci then you
should have compiled the original code, not tested different
functions. The code you provided works fine compiled and I too am
curious what is going on when
On 27 Oct 2009, at 15:47, Thomas DuBuisson wrote:
If you wanted to make sure it didn't have to do with ghci then you
should have compiled the original code, not tested different
functions.
That is a very good point!
On 27 Oct 2009, at 16:00, Daniel Fischer wrote:
Look at the sources:
On Tue, 2009-10-27 at 17:00 +0100, Daniel Fischer wrote:
Look at the sources:
hGetLine :: Handle - IO ByteString
hGetLine h = wantReadableHandle Data.ByteString.hGetLine h $ \ handle_ - do
case haBufferMode handle_ of
NoBuffering - error no buffering
_other -
duncan.coutts:
On Tue, 2009-10-27 at 17:00 +0100, Daniel Fischer wrote:
Look at the sources:
hGetLine :: Handle - IO ByteString
hGetLine h = wantReadableHandle Data.ByteString.hGetLine h $ \ handle_ -
do
case haBufferMode handle_ of
NoBuffering - error no buffering
Ok maybe a noob question, but hopefully its an easy one.
This is what I've got so far:
test :: x-[a] - (b,[b])
test x arrlist = let test1 = x
a = filter (\n - fst n == test1) arrlist
test2 = map snd a
in (test1, [test2
Am Sonntag 25 Oktober 2009 00:27:50 schrieb spot135:
Ok maybe a noob question, but hopefully its an easy one.
This is what I've got so far:
test :: x-[a] - (b,[b])
That can't be. The implementation below has type
Eq a = a - [(a,b)] - (a,[b])
test x arrlist = let test1 = x
Daniel Fischer-4 wrote:
Am Sonntag 25 Oktober 2009 00:27:50 schrieb spot135:
Ok maybe a noob question, but hopefully its an easy one.
This is what I've got so far:
test :: x-[a] - (b,[b])
That can't be. The implementation below has type
Eq a = a - [(a,b)] - (a,[b])
test x
),('b',2)]
test2 :: (Ord a) = [(a, b)] - [(a, [b])]
test2 l =
map (\grp - (fst (head grp), map snd grp)) ((groupBy ((==) `on`
fst)) l)
ex2 = test [('a',1),('a',2),('a',3),('b',1),('b',2)]
On Oct 24, 2009, at 5:27 PM, spot135 wrote:
Ok maybe a noob question, but hopefully its an easy
[snip]
Not a hack, a solution. A consistent one. Look:
(`foldl` 0)
(`-` 2)
Don't they look exactly the same?
[snip]
These look the same too (and *are* consistent):
(f a b)
(+ a b)
But it's not Haskell..
IMO conflating binary minus and unary minus is not consistent.
Something I wonder
Something I wonder from time to time if it would be a good thing or
not is to allow
a `f g` b
to mean
f g a b
You don't have to wonder:
http://www.haskell.org/haskellwiki/Infix_expressions
Granted, you have to use different characters rather than the
backquote. On the other
Jason Dagit dagit at codersbase.com writes:
On Mon, Oct 19, 2009 at 5:53 PM, Will Ness will_n48 at yahoo.com wrote:
You think of functions, where domain matters (for purists?). In syntax
only the result matter, does it read? Does it have an intended meaning?
How is it a mistake if it
It's worth remembering that APL and SML, amongst others,
distinguish between the sign used for a negative literal
(¯1 in APL, ~1 in SML) and the sign used for subtraction
(the hyphen/minus in both of them). It doesn't seem to
be a hard thing to get your head around in practice.
From having
minh thu wrote:
Something I wonder from time to time if it would be a good thing or
not is to allow
a `f g` b
to mean
f g a b
This comes up from time to time, though it is often met with stern
disapproval because it can easily lead to loss of clarity. There is a
valid alternative, though
wren ng thornton wren at freegeek.org writes:
Will Ness wrote:
(`foldl`2) works.
(`-`2) should too.
The `` syntax is for converting lexical identifiers into infix
operators. Symbolic identifiers are already infix, which is why ``
So it would be a no-op then. Why make it
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_...@yahoo.com wrote:
This syntax already exists. The '`' symbol is non-collating already, so using
it for symbol chars doesn't change anything (it's not that it can be a part of
some name, right?). To turn an infix op into an infix op is an id
Tom Tobin korpios at korpios.com writes:
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_n48 at yahoo.com wrote:
This syntax already exists. The '`' symbol is non-collating already, so
using it for symbol chars doesn't change anything (it's not that it
can be a part of some name,
Will Ness wrote:
wren ng thornton writes:
Attack the underlying problem, don't introduce hacks to cover up broken
hacks. This isn't C++.
The underlying problem is a broken scanner where it can't distinguish between a
binary op and a number read syntax.
The underlying problem is that (1)
On Mon, Oct 19, 2009 at 5:53 PM, Will Ness will_...@yahoo.com wrote:
Tom Tobin korpios at korpios.com writes:
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_n48 at yahoo.com
wrote:
This syntax already exists. The '`' symbol is non-collating already, so
using it for symbol chars
On Sun, Oct 18, 2009 at 5:31 PM, Will Ness will_...@yahoo.com wrote:
Luke Palmer lrpalmer at gmail.com writes:
Or you could use the subtract function.
map (subtract 2) [3,4,5]
[1,2,3]
I don't want to.
I think at about this point, this stopped being an intellectual
discussion.
Gregory Propf gregorypropf at yahoo.com writes:
I actually meant it as sort of a joke but maybe it's not after all.
Seriously though, using anything non-ASCII in source code is a bad idea,
because there are lots of fonts and editors in the world.
It seems natural to me to have (`-`2)
On Sun, Oct 18, 2009 at 4:47 PM, Will Ness will_...@yahoo.com wrote:
Gregory Propf gregorypropf at yahoo.com writes:
I actually meant it as sort of a joke but maybe it's not after all.
Seriously though, using anything non-ASCII in source code is a bad idea,
because there are lots of fonts
Luke Palmer lrpalmer at gmail.com writes:
Or you could use the subtract function.
map (subtract 2) [3,4,5]
[1,2,3]
I don't want to.
I don't think syntax sugar is worth it in this case.
I do. Operators are great because they make our intent visible, immediately
apparent. Long
Will Ness wrote:
Luke Palmer lrpalmer at gmail.com writes:
Or you could use the subtract function.
map (subtract 2) [3,4,5]
[1,2,3]
I don't want to.
I don't think syntax sugar is worth it in this case.
I do. Operators are great because they make our intent visible, immediately
Just a Haskell beginner question.
If I load in GHCi the code below all works fine, I load a file and its content
is shown on screen. But if I use the second version of my load_by_key (the
commented one) no error is reported loading and executing this code, but
nothing is shown on screen
)
hClose
(\h - hGetContents h = cont)
Hope this helps. By the way, this type of question should probably go to
haskell-c...@haskell.org which will usually give you a lot of
explanation quite quickly.
Regards,
Philip
[1]
http://haskell.org/ghc/docs/latest/html
Am Mittwoch 14 Oktober 2009 08:26:10 schrieb Luca Ciciriello:
Just a Haskell beginner question.
This sort of generic question has a higher probability of receiving a quick
answer on
haskell-c...@haskell.org or beginn...@haskell.org, where more people are
reading.
If I load in GHCi the code
Thanks Philip and Daniel for your help. Your explanation is clear.
Thanks also for direct me on the right news letters :-)
Luca.
_
Chat to your friends for free on selected mobiles
I'm having some trouble with QuickCheck2 and Control.Applicative.
Specifically, I have the following functions (slightly simplified):
copyVector :: IOVector - Vector - IO ()
freezeVector :: IOVector - IO (Vector)
I have a test, part of which looks like
monadicIO $ do
run $
Cristiano Paris wrote:
On Thu, Oct 8, 2009 at 12:48 PM, Lennart Augustsson wrote:
The reason a gets a single type is the monomorphism restriction (read
the report).
Using NoMonomorphismRestriction your example with a works fine.
Could you explain why, under NoMonomorphismRestriction, this
2009/10/9 wren ng thornton w...@freegeek.org:
Cristiano Paris wrote:
On Thu, Oct 8, 2009 at 12:48 PM, Lennart Augustsson wrote:
The reason a gets a single type is the monomorphism restriction (read
the report).
Using NoMonomorphismRestriction your example with a works fine.
Could you
Hi,
I'd like to know what are the typing rules used in Haskell (98 is ok).
Specifically, I'd like to know what makes
let i = \x - x in (i True, i 1)
legal, and not
let a = 1 in (a + (1 :: Int), a + (1.0 :: Float))
Is it correct that polymorphic functions can be used polymorphically
(in
minh thu wrote:
Also, I'd like to know why
id id True
is permitted but not
(\f - f f True) id
Because this requires rank-2 types:
Prelude :set -XScopedTypeVariables
Prelude :set -XRank2Types
Prelude (\(f :: forall a. a - a) - f f True) id
True
HTH,
Martijn.
minh thu wrote:
Also, I'd like to know why
id id True
is permitted but not
(\f - f f True) id
If you want to do this, answer the question what is the type of (\f -
f f True)?
You can do this, by the way, using rank-2 types:
{-# LANGUAGE Rank2Types, PatternSignatures #-}
thisIsAlwaysTrue
Excerpts from Bryan O'Sullivan's message of Wed Oct 07 23:25:10 +0200 2009:
On Wed, Oct 7, 2009 at 1:59 PM, Michael Mossey m...@alumni.caltech.eduwrote:
My thread about randomness got hijacked so I need to restate my remaining
question here. Is it acceptable to write pure routines that use
2009/10/8 Jochem Berndsen joc...@functor.nl:
minh thu wrote:
Also, I'd like to know why
id id True
is permitted but not
(\f - f f True) id
If you want to do this, answer the question what is the type of (\f -
f f True)?
You can do this, by the way, using rank-2 types:
{-# LANGUAGE
1101 - 1200 of 4551 matches
Mail list logo