The required context on pattern synonyms isn't just useful, it's
necessary. Since arbitrary computation can happen in both the pattern
matching and construction we need the context.
Take Richard's example, without the context on Positive we would infer the
wrong type for any use of the Positive
Order of evaluation can be very important for memory use. So I can imagine
cases where seq would run out of memory, but pseq would not.
I would argue that pseq is almost always what you want, but seq has a nicer
denotational semantics.
-- Lennart
On Friday, April 29, 2016, José Manuel
experimentation with language features, but I'm very conservative
about using them in production code.
-- Lennart Augustsson
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-prime
I agree that backslash string wrapping is obscure.
I do use it a lot, but I would not be sad to see it go.
The same is true for \a, \b, \f, \v, \EM, \DC1, etc.
We do need \, though.
On Tue, Oct 2, 2012 at 10:17 PM, Evan Laforge qdun...@gmail.com wrote:
The backslash string wrapping feature is
It's not often that one gets the chance to change something as
fundamental as the scoping rules of a language. Nevertheless, I would
like to propose a change to Haskell's scoping rules.
The change is quite simple. As it is, top level entities in a module
are in the same scope as all imported
An optional shadowing warning (for the paranoid) seems reasonable.
On Tue, Jul 24, 2012 at 1:45 AM, Greg Weber g...@gregweber.info wrote:
sounds good. will there be a shadowing warning?
On Mon, Jul 23, 2012 at 5:28 PM, Lennart Augustsson
lenn...@augustsson.net wrote:
It's not often
For instance, at your day job, the Array type.
On Wed, Oct 5, 2011 at 12:23 PM, Roman Leshchinskiy r...@cse.unsw.edu.auwrote:
Simon Peyton-Jones wrote:
I'm not sure if this plan would support [(fred,45), (bill,22)] :: Map
String Int. Probably not. Maybe that's a shortcoming... but such
What are the defaulting rules for IsList? It needs to be backwards compatible.
-- Lennart (iPhone)
On Sep 30, 2011, at 19:28, George Giorgidze giorgi...@gmail.com wrote:
GHC Users,
I would like to make to the following two proposals:
* Eliminate the default grouping close from
I'm not convinced there are enough use cases to warrant the extra complexity.
-- Lennart (iPhone)
On Sep 30, 2011, at 14:21, Christian Maeder christian.mae...@dfki.de wrote:
Hi,
the following sections are currently legal in Haskell:
(a + b +) and (++ a ++ b)
because + is left and
If you do [0.1, 0.2 .. 0.3] it should leave out 0.3. This is floating point
numbers and if you don't understand them, then don't use them. The current
behaviour of .. for floating point is totally broken, IMO.
-- Lennart
On Fri, Sep 23, 2011 at 6:06 AM, Chris Smith cdsm...@gmail.com wrote:
I totally agree with you. Haskell is very broken when it comes to [x..y]
for floating point.
It's an attempt to make it more friendly for naive users, but there is no
way FP can be made friendly. Any such attempts will fail, so make it usable
for people who understand FP instead.
-- Lennart
You seem to ignore garbage collection.
On Sat, Sep 24, 2011 at 6:40 AM, Arseniy Alekseyev
arseniy.alekse...@gmail.com wrote:
Apparently it doesn't, and it seems to be fixed now.
Does anyone know what exactly the bug was? Because this seems like a
serious bug to me. I've run into it myself
Also beware that Typeable uses the original names of types, which means that
moving basic types around totally wrecks backwards compatibility for those of
us who use the type name for serialization etc.
-- Lennart (iPhone)
On Aug 19, 2011, at 11:00, Johan Tibell johan.tib...@gmail.com
Djinn takes a type, what you have written does not appear to be a type.
-- Lennart
On Thu, Apr 7, 2011 at 3:35 PM, Martin jobmatt...@gmail.com wrote:
After reading this post, i can only see a - b
how to define more specific such as
flow 0 y = y
flow z flow x, y = flow z+x, y
could
It probably is portable, but I'd think only GHC has all the necessary
extensions.
On Sun, Jan 23, 2011 at 12:27 PM, Maciej Piechotka uzytkown...@gmail.comwrote:
It may be strange question but:
- Is SHE portable (assuming that the compiler have the extensions)?
- If yes why there is only
That looks like it looses the efficiency of the underlying representation.
On Sun, Jan 9, 2011 at 6:45 AM, Sebastian Fischer fisc...@nii.ac.jp wrote:
On Sun, Jan 9, 2011 at 6:53 AM, Lennart Augustsson lenn...@augustsson.net
wrote:
It so happens that you can make a set data type
It so happens that you can make a set data type that is a Monad, but it's
not exactly the best possible sets.
module SetMonad where
newtype Set a = Set { unSet :: [a] }
singleton :: a - Set a
singleton x = Set [x]
unions :: [Set a] - Set a
unions ss = Set $ concatMap unSet ss
member :: (Eq a)
First, what type would such a function have?
Certainly not [a]-[b], because that type say that it can take a list of any
type and turn it into a list of any other type, e.g.,
[Int]-[Bool].
On Thu, Dec 30, 2010 at 4:05 AM, william murphy will.t.mur...@gmail.comwrote:
Hi All,
I've spent a lot
I think they are equally feasible, but as Simon says, we have avoided
introducing new global keywords.
And I think we should avoid it this time too. Why break programs when we
don't have to.
-- Lennart
On Fri, Dec 24, 2010 at 9:31 PM, Ian Lynagh ig...@earth.li wrote:
On Thu, Dec 23, 2010 at
Recursion replaces loops. If it needs to be monadic or not depends on what
you want to do.
On Sun, Dec 19, 2010 at 10:53 AM, ender crazyen...@gmail.com wrote:
2010/12/19 Henning Thielemann lemm...@henning-thielemann.de:
On Sun, 19 Dec 2010, ender wrote:
do
alloca $ \value - do
I bet they did try to contact the owner. But when the contact email no
longer works nobody will get the messages.
On Sat, Dec 18, 2010 at 3:35 PM, Ketil Malde ke...@malde.org wrote:
Karel Gardas karel.gar...@centrum.cz writes:
IO
On Thu, Dec 16, 2010 at 6:03 PM, John Smith volderm...@hotmail.com wrote:
On 15/12/2010 14:31, Lennart Augustsson wrote:
Yes, I think there should be a MonadFail distinct from MonadPlus.
Some types, like IO, are not in MonadPlus, but have a special
implementation of the fail method
Any refutable pattern match in do would force MonadFail (or MonadPlus if you
prefer). So
1. (MonadFail m) = a - m a, \ a - return a
2. (MonadFail m) = m a, mfail ...
3. (MonadFail m) = Maybe a - m a, \ a - case a of Nothing - mfail
...; Just x - return x
4. (Monad m) = a - b - m a, \
reasons (better error messages
was the excuse).
-- Lennart
On Wed, Dec 15, 2010 at 11:51 AM, John Smith volderm...@hotmail.com wrote:
On 15/12/2010 11:39, Lennart Augustsson wrote:
Any refutable pattern match in do would force MonadFail (or MonadPlus if
you prefer). So
1. (MonadFail m
Like everyone else I have no good solution.
When I had a ghc branch I used diff and patch to move my patches forward.
Not exactly what you expect to have to do with a version control system.
On Mon, Dec 6, 2010 at 1:57 AM, Iavor Diatchki iavor.diatc...@gmail.com wrote:
Hello,
I am doing some
KRC, Miranda, and LML all predate Haskell and have list comprehensions.
On Thu, Nov 4, 2010 at 3:16 PM, Jonathan Geddes
geddes.jonat...@gmail.com wrote:
Regardless of which languages got which features for which other
languages, Haskell is surely NOT a scripting language inspired by
python...
It happened at various universities around the world. Look at the
original Haskell committee and you'll get a good idea where.
The smallest Haskell I know of is Gofer/Hugs; it originally ran on a 640k PCs.
Before that languages like SASL and KRC ran on PDP-11 with 64k memory.
None of these had a
I don't understand. Why don't you use Haskell as the scripting language?
On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy permea...@gmail.com wrote:
Let us think, that we need some scripting language for our pure haskell
project and configure-compile-run is not a way. In such a case a
Jon, you beat me to it. I was going to mention Ponder.
But Ponder did have a builtin type, it had the function type built in. :)
-- Lennart
On Tue, Nov 2, 2010 at 9:47 PM, Jon Fairbairn
jon.fairba...@cl.cam.ac.uk wrote:
Andrew Coppin andrewcop...@btinternet.com writes:
The other day, I
It's working just fine. I've never wanted a mail client library. :)
-- Lennart
2010/10/27 Günther Schmidt gue.schm...@web.de:
Dear Malcolm,
since there is no mail client library even after 10+ years I suggest to
rethink the approach, because frankly, it's not working.
Günther
You can use Djinn to generate the glue. Note that in the example you
give there are many possible ways to make the glue just looking at the
types.
Changing the output types of f so they can't be confused with the
input types we get:
Djinn ? compose :: (c1 - a1 - d) - (a- b - c - (b1,c1,a1)) -
(a
I would not worry about doing that at runtime.
The only reliable way to make sure it happens at compile time that I
can think of would be some Template Haskell.
(Or some really deep magic with dictionaries.)
-- Lennart
On Mon, Oct 11, 2010 at 3:51 AM, Alexander Solla a...@2piix.com wrote:
Hi
That code is incorrect. You can't assume that the base for floating
point numbers is 2, that's something you have to check.
(POWER6 and z9 has hardware support for base 10 floating point.)
-- Lennart
On Fri, Oct 8, 2010 at 2:08 PM, Daniel Fischer daniel.is.fisc...@web.de wrote:
The methods
So it's a bug in the garbage collector. It's closing a handle that
clearly is still reachable, otherwise this would not have happened.
On Fri, Aug 13, 2010 at 10:53 AM, Simon Marlow marlo...@gmail.com wrote:
On 12/08/2010 21:59, Yitzchak Gale wrote:
Wei Hu wrote:
nonTermination _ =
Rather than high turnover it indicates (in my experience) that it's
difficult to fill positions in finance.
That's one reason they are advertised repeatedly.
On Tue, Aug 10, 2010 at 12:27 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Malcolm Wallace malcolm.wall...@me.com writes:
The former.
On Tue, Aug 10, 2010 at 2:59 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Lennart Augustsson lenn...@augustsson.net writes:
Rather than high turnover it indicates (in my experience) that it's
difficult to fill positions in finance.
That's one reason
Out of 10 people trained only 2 should do programming anyway. :)
On Fri, Aug 6, 2010 at 4:58 AM, Tom Hawkins tomahawk...@gmail.com wrote:
Hi Eil,
Have you had any trouble training people to use Haskell?
Yes. I find that out of 10 people I train, only about 2 pick it up
and run with it. I'm
But do you think there would be more Haskell jobs offered (in absolute
terms), if no investment firms offered jobs?
Is there some kind of quota of job offers that gets used up?
There seems to be more job applicants that job offers at the moment,
so I'm not sure what the problem is.
On Mon, Aug
Yes, for instance to be able to use functions as number.
Or to be able to use constructive real numbers as numbers, since
equality is not computable.
-- Lennart
On Thu, Aug 5, 2010 at 4:17 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 5 August 2010 10:15, Lennart Augustsson
You're right. It's bad to have toRational in Real. It's also bad to
have Show and Eq as superclasses to Num.
On Wed, Aug 4, 2010 at 8:30 PM, Omari Norman om...@smileystation.com wrote:
Why is toRational a method of Real? I thought that real numbers need not
be rational, such as the square
,
www.cs.kuleuven.be/~toms/Research/papers/constraint_families.pdf
On Tue, Jul 27, 2010 at 10:17 AM, o...@okmij.org wrote:
Lennart Augustsson wrote:
Try to make Set an instance of Functor and you'll see why it isn't.
It's very annoying.
And yet the very simple, and old solution works.
http
Try to make Set an instance of Functor and you'll see why it isn't.
It's very annoying.
On Mon, Jul 26, 2010 at 11:55 PM, Gregory Crosswhite
gcr...@phys.washington.edu wrote:
Is there a specific reason why Set doesn't have instances for Functor
and Traversable? Or have they just not been
Encapsulation is essential for constructing robust software.
How could we get rid of that and claim to have a serious language?
On Sat, Jun 19, 2010 at 8:38 PM, Christian Höner zu Siederdissen
choe...@tbi.univie.ac.at wrote:
Hi everybody,
I'd like some input on other peoples' thoughts on this.
I would not use the continuation monad just for early exit. Sounds
like the error monad to me.
2010/6/10 Günther Schmidt gue.schm...@web.de:
Hi everyone,
I'm about to write a rather lengthy piece of IO code. Depending on the
results of some of the IO actions I'd like the computation to stop
just consider cut free proofs there's usually infinitely many.)
On Fri, May 28, 2010 at 8:14 AM, wren ng thornton w...@freegeek.org wrote:
Lennart Augustsson wrote:
So what would you consider a proof that there are no total Haskell
functions of that type?
Or, using Curry-Howard, a proof
So what would you consider a proof that there are no total Haskell
functions of that type?
Or, using Curry-Howard, a proof that the corresponding logical formula
is unprovable in intuitionistic logic?
As I understand, in general this can only be proven using meta theory
rather than the logic
There are no interesting (i.e. total) functions of that type.
2010/5/25 Yitzchak Gale g...@sefer.org:
Günther Schmidt wrote:
http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=25694
in which I attempt to develop a currying combinator library.
I'm stuck at some point and would appreciate any
That's totally false. You don't evaluate 'undefined' before calling 'id'.
(Or if you, it's because you've made a transformation that is valid
because 'id' is strict.)
On Mon, May 24, 2010 at 9:05 AM, Alexander Solla a...@2piix.com wrote:
Yes, but only because it doesn't work at all. Consider
For Bool, I'm not sure, but for, e.g., () it's certainly true.
Take this definition of ==
() == _ = True
Using case analysis of just the constructors, ignoring the value
bottom, you can easily prove symmetry.
But '() == undefined' terminates, whereas 'undefined == ()' does not.
Ignore bottom
There is no clean proof of that statement because it is false.
(Consider the argument 'undefined'.)
2010/5/23 R J rj248...@hotmail.com:
Given the following definition of either, from the prelude:
either :: (a - c, b - c) - Either a b - c
either (f, g) (Left x)
Actually, I didn't notice the typo. It's still not a true statement.
(h . either (f, g)) undefined /= (either (h . f, h . g)) undefined
Also, it's not exactly the function either from the Prelude.
-- Lennart
2010/5/23 R J rj248...@hotmail.com:
Correction: the theorem is
h . either
Your question is actually deeper than some of the people answering you
seem to realize.
How does ghci decide what to do when you say
show []
?
The expression [] has type [a], which means it could be a list of any
type 'a', including Char.
Normally, when Haskell can't determine the type in this
The cost factor of Integer vs Int is far, far smaller than the factor
between computable reals vs Double.
On Thu, Apr 1, 2010 at 6:33 PM, Jens Blanck jens.bla...@gmail.com wrote:
Yes, the cost for computable reals will be an order of magnitude or possibly
two for well-behaved computations. For
Of course Haskell' should have an empty case. As soon as empty data
declarations are allowed then empty case must be allowed just by using
common sense.
On Tue, Mar 30, 2010 at 11:03 PM, Ashley Yakeley ash...@semantic.org wrote:
wagne...@seas.upenn.edu wrote:
I believe I was claiming that, in
What Don said.
2010/3/29 Don Stewart d...@galois.com:
gue.schmidt:
Hi all,
I notice that posts from the Haskell elders are pretty rare now. Only
every now and then we hear from them.
How come?
Because there is too much noise on this list, Günther
-- Don
Does anything change if you swap the first two rhss?
On Sun, Mar 28, 2010 at 1:28 AM, Roman Leshchinskiy r...@cse.unsw.edu.au
wrote:
On 28/03/2010, at 09:47, Lennart Augustsson wrote:
It's important to switch from mod to rem. This can be done by a
simple abstract interpretation.
Also
Thanks!
On Sat, Mar 27, 2010 at 11:59 PM, Ian Lynagh ig...@earth.li wrote:
On Thu, Mar 25, 2010 at 10:14:34PM +, Lennart Augustsson wrote:
#3904 should also be really easy to fix.
Yup, done.
Thanks
Ian
___
Glasgow-haskell-users mailing
It's important to switch from mod to rem. This can be done by a
simple abstract interpretation.
I'm nore sure if it's jhc or gcc that does this for jhc.
-- Lennart
On Sat, Mar 27, 2010 at 10:30 PM, Rafael Cunha de Almeida
almeida...@gmail.com wrote:
John Meacham wrote:
Here are jhc's
I would really like to see #3900 in there. On trac it's slated for
the 6.12.2 release, but I don't see it in your list.
#3904 should also be really easy to fix.
On Tue, Mar 23, 2010 at 6:38 PM, Ian Lynagh ig...@earth.li wrote:
Hi all,
This is a summary of our plans for GHC 6.12.2.
We plan
Turn on OverloadedStrings and you can pattern match on any type you
like that is in the IsString class.
Which means that Data.Text can use string literals just like regular
strings (but you can't use Char literals in the match).
On Mon, Mar 22, 2010 at 1:15 PM, Ivan Miljenovic
The usual way to do this would be to include the dependency on the RTS
in the library and then vary the RTS by using LD_PRELOAD.
I think ghc does it the wrong way.
-- Lennart
On Mon, Feb 22, 2010 at 10:00 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
Hi Tyson,
This blog post
If you use read (reads) and show for the actual conversion it will round trip.
It appears to be non-trivial since most languages and libraries get it wrong. :)
-- Lennart
On Tue, Feb 23, 2010 at 1:44 PM, Andy Gimblett hask...@gimbo.org.uk wrote:
Hi all,
Short version: How can I pretty print
Supply a fix for the problem, and it will probably get included.
There has probably been little demand for this feature so far.
-- Lennart
On Sun, Feb 21, 2010 at 10:21 PM, Ben Millwood hask...@benmachine.co.uk wrote:
On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke
I agree, I don't think this is a bug. If the grammar actually says
that this is legal, then I think the grammar is wrong.
On Sun, Feb 14, 2010 at 1:48 AM, John Launchbury j...@galois.com wrote:
I don't think this is a bug. I do not expect to be able to unfold a
definition without some
Well, something like such a tool exists, but I can't give it away.
On Fri, Feb 12, 2010 at 12:13 AM, Niklas Broberg
niklas.brob...@gmail.com wrote:
Anyone know of a type inference utility that can run right on haskell-src
types? or one that could be easily adapted?
This is very high on my
To do anything interesting you also to process modules, something
which I hope to contribute soon to haskell-src-exts.
On Thu, Feb 11, 2010 at 6:35 PM, Job Vranish job.vran...@gmail.com wrote:
Anyone know of a type inference utility that can run right on haskell-src
types? or one that could be
It does type inference, it's just not engineered to be part of a real compiler.
On Thu, Feb 11, 2010 at 6:41 PM, Stephen Tetley
stephen.tet...@gmail.com wrote:
http://web.cecs.pdx.edu/~mpj/thih/
Looks like its a type _checker_ though...
On 11 February 2010 17:39, Stephen Tetley
It's not true at all that Haskell was created by type theorists.
It is true that little attention was paid for how things are done in C. :)
On Tue, Feb 9, 2010 at 2:39 PM, johndea...@cox.net wrote:
It needs to be appreciated that the Haskell language was created by type
theorists who were
Do you deal with this correctly as well:
case () of _ - 1==1==True
On Tue, Feb 9, 2010 at 10:43 PM, S. Doaitse Swierstra doai...@cs.uu.nl wrote:
One we start discussing syntax again it might be a good occasion to
reformulate/make more precise a few points.
The following program is accepted
Of course unary minus should bind tighter than any infix operator.
I remember suggesting this when the language was designed, but the
Haskell committee was very set against it (mostly Joe Fasel I think).
I think it's too late to change that now, it could really introduce
some subtle bugs with no
The only safe rule is: if you don't control the class, C, or you don't
control the type constructor, T, don't make instance C T.
I agree in principle, but in the real world you can't live by this rule.
Example, I want to use Uniplate to traverse the tree built by haskell-src-exts,
Using
PL/I has keywords, they're just not reserved words.
With as many keywords as PL/I has, there something to say for not
making them reserved. :)
On Wed, Jan 13, 2010 at 11:50 AM, Brandon S. Allbery KF8NH
allb...@ece.cmu.edu wrote:
On Jan 13, 2010, at 05:45 , Ketil Malde wrote:
Brandon S. Allbery
I've put some of Oleg's code on hackage, named polytypeable.
import Data.PolyTypeable
main = print [polyTypeOf Nothing, polyTypeOf Just]
This prints
[Maybe a1,a1 - Maybe a1]
To get a list of the actual constructors you need to derive
Data.Data.Data and use that.
-- Lennart
On Wed, Dec
Did you consider using the traced package?
2009/12/24 Bas van Dijk v.dijk@gmail.com:
On Thu, Dec 24, 2009 at 1:00 AM, Andrey Sisoyev
andrejs.sisoj...@nextmail.ru wrote:
Where do you make use of it? :)
A few months ago I was working on 'levmar'[1] a Levenberg-Marquardt
data fitting
And if you use quotRem it's faster (unless you're running on some
exotic hardware like NS32K).
On Tue, Dec 8, 2009 at 10:19 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote:
On Dec 9, 2009, at 1:15 AM, Daniel Fischer wrote:
Am Dienstag 08 Dezember 2009 08:44:52 schrieb Ketil Malde:
Richard
Thank you Sir for giving me a good laugh!
On Thu, Dec 3, 2009 at 5:25 PM, John D. Earle johndea...@cox.net wrote:
Dear Emmanuel Chantréau,
You may want to look into Objective CAML http://caml.inria.fr/ which is a
French product as you can see from the Internet address. It is likely better
Try with -XExtendedDefaulingRules.
On Mon, Nov 16, 2009 at 6:33 AM, Mark Lentczner ma...@glyphic.com wrote:
I'm looking for a good way to handle a library interface that accepts both
strings and numbers in particular argument positions:
Start with the following definitions. I've defined
Hugs is wrong, as you can easily see by evaluating
let x = 123.35503 * 10.0 in x == read (show x)
With ghc it comes out as True and with Hugs as False.
-- Lennart
On Sat, Nov 14, 2009 at 9:00 PM, Abby Henríquez Tejera
parad...@gmail.com wrote:
Hi.
I've seen that in GHC sometimes there
Of the two declarations
data Fizzle a = Fizzle (b - (a, b)) a
data Fizzle a = forall b. Fizzle (b - (a, b)) a
only the second one is allowed (with some suitable extension).
Personally I think the first one should be allowed as well, with the
same meaning as the second one.
Some
Thanks Neil,
That was indeed my point. Since a compiler is a substantial program I
would have more confidence it a compiler that is self-hosting.
Surely you must have tried?
-- Lennart
On Fri, Nov 13, 2009 at 8:08 PM, Neil Mitchell ndmitch...@gmail.com wrote:
Hi John,
Do you use jhc when
John,
Do you use jhc when you develop jhc? I.e., does it compile itself.
For me, this is the litmus test of when a compiler has become usable.
I mean, if even the developers of a compiler don't use it themselves,
why should anyone else? :)
-- Lennart
On Wed, Nov 11, 2009 at 3:37 AM, John
If by minority platform you mean platforms that are resource starved,
like some embedded systems, then I would have to agree.
-- Lennart
On Wed, Nov 11, 2009 at 2:12 PM, Donn Cave d...@avvanta.com wrote:
Quoth Lennart Augustsson lenn...@augustsson.net,
Do you use jhc when you develop jhc
It's not an easy problem to pretty print (i.e. change indentation) and
preserve the comments. And always get it right.
On Tue, Oct 20, 2009 at 1:28 PM, Pasqualino Titto Assini
tittoass...@gmail.com wrote:
Thanks Niklas,
in fact this produced a source with comments:
import
Yes, there are simple H-M examples that are exponential.
x0 = undefined
x1 = (x1,x1)
x2 = (x2,x2)
x3 = (x3,x3)
...
xn will have a type with 2^n type variables so it has size 2^n.
-- Lennart
On Tue, Oct 13, 2009 at 6:04 PM, Brad Larsen brad.lar...@gmail.com wrote:
On Tue, Oct 13, 2009 at 3:37
The reason a gets a single type is the monomorphism restriction (read
the report).
Using NoMonomorphismRestriction your example with a works fine.
On Thu, Oct 8, 2009 at 12:29 PM, Cristiano Paris fr...@theshire.org wrote:
On Thu, Oct 8, 2009 at 11:04 AM, minh thu not...@gmail.com wrote:
Hi,
Indeed, the types
foo :: forall a . (Num a) = a - (Int, Float)
and
foo :: (forall a . (Num a) = a) - (Int, Float)
are quite different.
The first one say, I (foo) can handle any kind of numeric 'a' you (the
caller) can pick. You (the caller) get to choose exactly what type you
give me.
The
And what is a number? Are complex numbers numbers?
On Mon, Oct 5, 2009 at 3:12 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote:
Sönke Hahn wrote:
I used to implement
fromInteger n = (r, r) where r = fromInteger n
, but thinking about it,
fromInteger n = (fromInteger n, 0)
But complex numbers are just pairs of numbers. So pairs of numbers
can obviously be numbers then.
On Mon, Oct 5, 2009 at 4:40 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote:
Lennart Augustsson wrote:
And what is a number?
Can't say. You know, it's kinda funny to ask a biologist what
Everyone agrees that the Haskell numeric hierarchy is flawed, but I've
yet to see a good replacement.
On Mon, Oct 5, 2009 at 4:51 PM, Brad Larsen brad.lar...@gmail.com wrote:
On Mon, Oct 5, 2009 at 10:36 AM, Miguel Mitrofanov
miguelim...@yandex.ru wrote:
[...]
Of course, it's OK to call
: a)
admit that complex numbers and double numbers are the same - and most
mathematicians would agree they aren't - or b) admit that the relation be
the same is not transitive - which is simply bizarre.
Lennart Augustsson wrote:
But complex numbers are just pairs of numbers. So pairs of numbers
OK, just pairs have no arithmetic, but one way of defining
arithmetic is to treat the pairs as complex numbers. Or as mantissa
and exponent. Or as something else. So there's nothing wrong, IMO,
to make pairs an instance of Num if you so desire. (Though I'd
probably introduce a new type.)
On
Prelude toRational 697.04157958259998
3065621287177675 % 4398046511104
Prelude toRational 697.0415795826
3065621287177675 % 4398046511104
As you can see, both numbers are represented by the same Double.
Haskell prints a Double with the simplest number that converts back to
the same bit pattern.
be a small penalty.
-- Lennart
On Tue, Aug 25, 2009 at 3:20 PM, Henning
Thielemannlemm...@henning-thielemann.de wrote:
On Sun, 23 Aug 2009, Lennart Augustsson wrote:
You're absolutely right. It would be easy to change logBase to have
special cases for, say, base 2 and base 10, and call the C
You're absolutely right. It would be easy to change logBase to have
special cases for, say, base 2 and base 10, and call the C library
functions for those. In fact, I think it's a worth while change,
since it's easy and get's better results for some cases.
-- Lennart
On Sun, Aug 23, 2009 at
Even if you are only slightly irritated by offset syntax, why are you using it?
{;} works fine.
On Sat, Aug 22, 2009 at 3:51 AM, John D. Ramsdellramsde...@gmail.com wrote:
Let me put all my cards on the table. You see, I really am only
slightly irrigated by offset syntax. In contrast, I am a
Internally GHC does have to enforce the ordering on IO operations somehow.
If there actually was a RealWorld value being passed around you could
use some version of seq the guarantees sequential evaluation.
But GHC doesn't even pass a RealWorld around, the sequencing is
enforced by different
You need a lot of magic to make the IO monad efficient.
You don't really want to pass around (and pattern match on) a
RealWorld token, that would be inefficient.
On Fri, Aug 21, 2009 at 11:04 AM, Peter Verswyvelenbugf...@gmail.com wrote:
IO also seems to use unboxed (hence strict?) tuples
The IO in hbc was (is) the old request-response model, on top of which
there was also a continuation layer, as well as the monadic IO (once
that was invented). It involved a lot more C code handling the
requests than I really liked.
BTW, unsafePerformIO is pretty ugly to implement in the
Using seq to control a program's semantics (as in, input-output
behaviour) is a horrible hack.
The seq operation there to control space and time aspects of your program.
(The specification of seq doesn't even say that the first argument is
evaluated before the second one.)
You should use data
No, there's no way you can change the value of 'a' after the fact.
Since 'a' is a constant the compiler has most likely inlined it
wherever it has been used, the done constant folding etc.
If you need an updateable variable, you need to tell the compiler,
otherwise it will assume your code is
1 - 100 of 1011 matches
Mail list logo