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 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 you demonstra
Koalas are slow and lazy animals. I think the choice is highly appropriate.
-- Lennart
On Wed, Apr 1, 2009 at 8:22 AM, Colin Paul Adams
wrote:
>> "Simon" == Simon Peyton-Jones writes:
>
> Simon> So I hereby declare the official Haskell mascot to be the
> Simon> koala, in the form o
.
With that in place I think the code could be quite performant.
-- Lennart
On Sun, Mar 29, 2009 at 3:13 PM, Jason Dusek wrote:
> 2009/03/29 Lennart Augustsson :
>> ...GHC lacks certain optimizations to make efficient code when
>> using CMonad, so instead of C speed you get low spee
I've uploaded my CMonad package to Hackage. It allows you to write
Haskell code in a C style.
Unfortunately, GHC lacks certain optimizations to make efficient code
when using CMonad,
so instead of C speed you get low speed.
Example: Computing some Fibonacci numbers:
fib = do {
a <- arrayU[40]
The quote has been around since at least the early 80s, but I don't
know who it's from.
2009/3/28 Krzysztof Skrzętnicki :
> This paper from 1994:
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.36.5611
> begins point 1.1 with exactly that sentence. It doesn't seem to be
> quoted there, s
I don't see any breaking of referential transparence in your code.
Every time you do an IO operation the result is basically
non-deterministic since you are talking to the outside world.
You're assuming the IO has some kind of semantics that Haskell makes
no promises about.
I'm not saying that thi
Does this version work from ghci?
-- Lennart
On Wed, Feb 11, 2009 at 5:40 AM, Peter Gavin wrote:
> Hi everyone,
>
> Oh, dear... it seems I've forgotten how to spell "cafe", and sent this
> message to haskell-c...@haskell.org the first time around. I resent it to
> all the lists again (just to
A loop without turning on a flag to allow it must be a bug.
-- Lennart
On Mon, Jan 19, 2009 at 2:04 PM, Sittampalam, Ganesh
wrote:
> Doug McIlroy wrote:
>> A fragment of an attempt to make pairs serve as complex numbers,
>> using ghc/hugs extensions:
>>
>> instance Num a => Num (a,a) w
gt; IO Int32))
cgplus =
createFunction InternalLinkage $ \ x y -> do
r <- add x y
ret r
main = do
ioplus <- simpleFunction cgplus
let plus = unsafePurify ioplus
print $ plus 20 22
Enjoy!
Bryan O'Sullivan
Another parse error:
newtype CodeGenModule a = CGM (StateT CGMState IO a)
deriving (Monad, MonadState CGMState, MonadIO)
On Sat, Dec 20, 2008 at 9:55 AM, Neil Mitchell wrote:
> Hi,
>
> I am pleased to announce HLint, a tool for making suggestions to
> improve your Haskell code. Previously t
It would be nice if HLint didn't suggest things that it will object to
in the next round.
Like
LLVM/Core/CodeGen.hs:176:1: Eta reduce
Found:
applyArgs f g = apArgs 0 f g
Why not:
applyArgs f = apArgs 0 f
BTW, great tool!
-- Lennart
___
Haskell ma
The typehash library allows you to produce a unique identifier (a
cryptographic hash) for a type.
This is useful if you save values of some type to a file (text,
binary, whatever format you wish)
and then when you read it back in again you want to verify that the
type you want to read is the
one yo
Before we can talk about what right and wrong we need to know what the
semantics of IVars should be.
On Dec 8, 2007 7:12 PM, Marc A. Ziegert <[EMAIL PROTECTED]> wrote:
> many many answers, many guesses...
> let's compare these semantics:
>
> readIVar :: IVar a -> IO a
> readIVar' :: IVar a -> a
>
; out. If the operation was pure (no IO) then you'd have a lot less control
> over when it happened.
>
>
>
> Simon
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Lennart Augustsson
> *Sent:* 04 December 2007 08:19
> *To:* Cona
question: why the IO in readIVar :: IVar a -> IO a, instead of
> just readIVar :: IVar a -> a? After all, won't readIVar iv yield the same
> result (eventually) every time it's called?
>
>
> On Dec 3, 2007 12:29 AM, Lennart Augustsson <[EMAIL PROTECTED]>
>
You can make them from MVars.
On Dec 2, 2007 8:03 PM, Conal Elliott <[EMAIL PROTECTED]> wrote:
> what became of (assign-once) IVars? afaict, they were in concurrent
> haskell and now aren't.
>
> ___
> Haskell mailing list
> Haskell@haskell.org
> http:/
I totally agree with Derek. Which exception you get can vary with compiler
version, compiler flags, time of day, phase of the moon, ...
It will be one in a set of exceptions, but you don't know which one.
-- Lennart
On Nov 18, 2007 8:34 PM, Derek Elkins <[EMAIL PROTECTED]> wrote:
> On Sun, 20
Oh, so you want the original behaviour of type declarations back. :)
In Haskell 1.0, if you didn't specify any deriving, you got as much
derived as possible. I quite liked it, but it was changed.
-- Lennart
On Tue, 22 May 2007, Alex Jacobson wrote:
Date: Tue, 22 May 2007 19:07:26 -0
Hi all,
Credit Suisse has started using Haskell within GMAG, the group that
provides financial analytics for the bank. The main use of Haskell
is for a Domain Specific Embedded Language that is being used by the
people writing the financial analytics (these people typically have a
PhD in
Excellent! It's good too see that the GHC complexities will be
appreciated by someone. Yet Dr Tuldoso has much left to discover.
Like the near hopeless task of trying to keep a local GHC version
with a few patches up to date with darcs without getting totally
entangled in conflicts, acce
On Dec 11, 2006, at 03:50 , Johannes Waldmann wrote:
let data Bar = ... in ...
If you allow this you need to be very careful about type equality.
When is Bar equal to Bar?
If it's inside a recursive function, does each invocation get its own
Bar? (In SML the answer is yes.) If you d
Oh, come on. It's not that bad. Just start every module with
import Prelude()
import MyPrelude
that's what I do. There's nothing sacred about the Prelude (except a
few things used for special syntax). It just happens to be in scope.
-- Lennart
On Dec 8, 2006, at 15:04 , Dan We
That's great! Thanks for the hard work, Krasimir.
One question, where can I find the source? I didn't see anything
about that on the download page.
-- Lennart
On Nov 28, 2006, at 02:30 , Krasimir Angelov wrote:
Hello Haskellers,
I am happy to announce that there is a prerelease
Well, Kent Petersson and I proposed them as an addition to Haskell in
1994, so they are not that new. :)
-- Lennart
http://web.cecs.pdx.edu/~sheard/papers/silly.pdf
On Oct 11, 2006, at 09:47 , Paul Hudak wrote:
Lennart Augustsson wrote:
Well, I think the GADT type definition
On Oct 11, 2006, at 03:58 , Bulat Ziganshin wrote:
Hello oleg,
Wednesday, October 11, 2006, 6:12:23 AM, you wrote:
Annotate the data type using a GADT:
data MyData a where
MyCon :: MyData a
It helps to reduce confusion about the merits of various features and
additions to Haskell if we u
Well, you can do it with the existing recursion in Haskell
let yc f = f (yc f)
Or you can encode it with type level recursion and no value recursion
by using a recursive data type.
-- Lennart
On Sep 15, 2006, at 08:11 , Haihua Lin wrote:
Hi,
Writing
yc = \f -> (\x -> f(x x
Just a somewhat related fact:
A standard Hindley-Milner type checker (deducer) has the same power
as a Turing machine with a finite tape. I.e., the same power as a
computer, since they have finite memory. :)
-- Lennart
On Aug 10, 2006, at 22:04 , Robert Dockins wrote:
...
__
Why not ask the computer?
-- Lennart
bamse% ghci
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4.1, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\/\/ /_/\/|_| Type :? for help.
Loading package base
Yeah, I think it boils down to different representations of NaN on
different platform. I guess I forgot to test for NaN when I wrote
(the C code for) decodeFloat. It should generate some consistent
result.
On the other hand, if you have code that possible divides by 0
and don't check for it, wel
Ashley Yakeley wrote:
In article <[EMAIL PROTECTED]>,
Lennart Augustsson <[EMAIL PROTECTED]> wrote:
On the whole it looks like you want type variables with kind #.
There are very good implementation reasons for not allowing this.
If you had type variables of kind # you could have
Niklas Sorensson wrote:
That's what I thought. But I'm still curious when it is used, and why
it isn't a suitable solution for unboxed polymorhic functions in most
cases.
But getting most cases right isn't enough, you have to get all cases
right. So if you want to have unboxed polymorphic func
On the whole it looks like you want type variables with kind #.
There are very good implementation reasons for not allowing this.
If you had type variables of kind # you could have polymorphic
functions over unboxed values. But since the values are unboxed
they don't have a uniform representation
[EMAIL PROTECTED] wrote:
In the following example we will be using a simplified (and perhaps,
more elegant) system than the one used in the class. The typechecker
uses only conjunctions and disjunctions. The evaluator of the logic
system is complete: if there is a solution, the evaluator
will alw
Thanks! It's in the next version.
I'll also make the license less restrictive. (With no
explicit copyright information in the files the default
copyright applies, i.e., I have all rights.)
-- Lennart
Henning Günther wrote:
Hi Lennart,
I really like djinn and decided to write a quick
Well, the proof search is terminating (and complete) so
it has to stop somewhere. That happens to be result with
this particular search strategy.
-- Lennart
Chung-chieh Shan wrote:
Lennart Augustsson <[EMAIL PROTECTED]> wrote in article <[EMAIL PROTE
There is a new version of Djinn available, with two notable
new features: Haskell data types can be defined and the
found functions are sorted (heuristically) to present the
best one first.
To play with Djinn do a
darcs get http://darcs.augustsson.net/Darcs/Djinn
or get
http://darcs.augustsso
Howdy, y'all!
I've written a small program that takes a (Haskell) type
and gives you back a function of that type if one exists.
It's kind of fun, so I thought I'd share it.
It's probably best explained with a sample session.
calvin% djinn
Welcome to Djinn version 2005-12-11.
Type :h to g
Simon Peyton-Jones wrote:
| I am aware of some experiments with alternative back-ends for ghc, but
I
| don't know of any work on a ghc back-end generating portable bytecode.
| A few years ago some work was done towards a ghc-hugs fusion, but in
the
| end hugs remained separate and the ghc people
Simon Marlow wrote:
On 02 November 2005 00:20, Lennart Augustsson wrote:
Furthermore, ghc has a WRONG definition of sum.
Surely not... sum is defined by Haskell 98 as:
sum = foldl (+) 0
and this is exactly what GHC provides. Furthermore we have specialised
strict versions for Int and
Cale Gibbard wrote:
On 01/11/05, Sebastian Sylvan <[EMAIL PROTECTED]> wrote:
On 11/1/05, Scherrer, Chad <[EMAIL PROTECTED]> wrote:
I was wondering... In my experience, it's worked much better to use
sum' = foldl' (+) 0
than the built-in "sum" function, which leaks memory like crazy for
larg
Simon Marlow wrote:
I agree with you. And that is how it used to be, but then
some people didn't think that was convenient enough so now
we are stuck with a seq that (IMHO) stinks. :)
Having a seq that works on anything is occasionally very useful for
fixing space leaks, and the type class ve
Wolfgang Jeltsch wrote:
Am Mittwoch, 5. Oktober 2005 16:22 schrieb Simon Marlow:
[...]
Also, GHC's optimiser currently treats (_|_ :: IO a) and (do _|_; return
()) as interchangeable, which is naughty, and people have occasionally
noticed, but the benefits can sometimes be huge. It is this
Not all FP representations have infinity, and even if
they do, they might only have one infinity.
-- Lennart
Frederik Eaton wrote:
I've previously mentioned that I would like to see an 'instance
Bounded Double' etc., as part of the standard, which would use 1/0 for
maxBound, or the larg
The RealFloat class has a number of methods for testing
various properties of a FP number:
isNaN :: a -> Bool
isInfinite :: a -> Bool
isDenormalized :: a -> Bool
isNegativeZero :: a -> Bool
isIEEE :: a -> Bool
If you really want to create an Infinity, I suggest 1/0,
but not all FP forma
But who said you should remove the import of word32ToInt?
It was only fromIntegral that was discussed.
-- Lennart
Alex Edelsburg wrote:
Thanks for your suggestion.
--import Word (fromIntegral)
--import Word (word32ToInt)
I removed both import statements from the code and tried to run ag
with {}.
Thanks,
Frederik
On Thu, Jul 14, 2005 at 02:42:53AM +0200, Lennart Augustsson wrote:
That's how it is defined in the Haskell definition.
But there is a reason. The offside rule (or whatever yoy want to
call it) is there to give visual cues. If you were allowed to override
these e
That's how it is defined in the Haskell definition.
But there is a reason. The offside rule (or whatever yoy want to
call it) is there to give visual cues. If you were allowed to override
these easily just because it's parsable in principle then your code
would no longer have these visual cues
er
the typing precision of OO.
So I am willing to give in on b)
but I maintain a)
and I really miss extensible datatypes :-)
Ralf
(doing too much C# these days I guess)
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
Behalf Of Lennart Augustsson
Sent:
Andrew Ward wrote:
Hi All,
In Simon Thompson's The Craft of Functional Programming Second Edition,
page 226, it is mentioned that Laufer (1996) describes a Haskell
extension to allow dynamic binding. I was wondering if this has been
implemented as an extension in any of the haskell compilers,
that portability seems like
another reason to define a Bounded instance for Double. That way users
could call 'maxBound' and 'minBound' rather than 1/0 and -(1/0)...
Frederik
On Fri, Mar 11, 2005 at 11:10:33AM +0100, Lennart Augustsson wrote:
Haskell does not guarantee that 1/0 is w
seems like
another reason to define a Bounded instance for Double. That way users
could call 'maxBound' and 'minBound' rather than 1/0 and -(1/0)...
Frederik
On Fri, Mar 11, 2005 at 11:10:33AM +0100, Lennart Augustsson wrote:
Haskell does not guarantee that 1/0 is well defined
Haskell does not guarantee that 1/0 is well defined,
nor that -(1/0) is different from 1/0.
While the former is true for IEEE floating point numbers,
the latter is only true when using affine infinities.
-- Lennart
Frederik Eaton wrote:
Shouldn't Double, Float, etc. be instances of Bounded?
Cale Gibbard wrote:
Another common thing which is done whenever convenient is to treat
Cartesian product as associative, and naturally identify the spaces (A
x A) x A and A x (A x A), along with perhaps A^3 which might be
functions f: {0,1,2} -> A,
It's fine to identify (A x A) x A with A x (A x A
It doesn't have to be a top level definition, it works anyway.
-- Lennart
Bruno Abdon wrote:
'hamming', in your code, is a top-level definition. When used three
times inside its own definition, it's the same variable being used
three times. You don't recompute a variable value in order to r
Well, this compiles:
data T a where
BoolT :: T Bool
IntT :: T Int
neverT' :: T a -> x
neverT' BoolT = error "Bool"
neverT' IntT = error "Int"
neverT :: T Char -> x
neverT = neverT'
But it uses error for the unreachable cases, maybe not what you want.
-- Lennart
Ashley Yakeley wrot
But surely any device driver is parametrized on the
exact IO addresses? How would you be able to handle
multiple devices otherwise?
Adrian Hey wrote:
On Friday 26 Nov 2004 11:39 am, Keean Schupke wrote:
Adrian Hey wrote:
Well it can be written in Haskell, but not using a module that was
specifical
Tomasz Zielonka wrote:
On Thu, Nov 25, 2004 at 07:52:43PM +0100, Lennart Augustsson wrote:
As I'm sure you have gathered from all the answers you can't have the
latter and keep Haskell pure. But there is an interesting alternative
(at least theoretically). You could have a fun
Keean Schupke wrote:
Daan Leijen wrote:
You are right, I feel like that too: one should expect that the type
checker can figure this out, and perhaps it is even really useful.
On the other hand, suppose you decide later to export the
class, and suddenly your code would no longer type check.
I must
Daan Leijen wrote:
You are right, I feel like that too: one should expect that the type
checker can figure this out, and perhaps it is even really useful.
On the other hand, suppose you decide later to export the
class, and suddenly your code would no longer type check.
The fact that adding an expo
Jules Bean wrote:
By the same token, you can just stick the function strangeReadFile ::
FilePath -> String into the language. As long as it is memoized, always
returning the same value, it doesn't break beta-reduction. I call it
'strange' because the time that the file is actually read is not
g
Tomasz Zielonka wrote:
On Thu, Nov 25, 2004 at 07:52:43PM +0100, Lennart Augustsson wrote:
As I'm sure you have gathered from all the answers you can't have the
latter and keep Haskell pure. But there is an interesting alternative
(at least theoretically). You could have a fun
John Goerzen wrote:
So why do we have:
catchJust :: (Exception -> Maybe b) -> IO a -> (b -> IO a) -> IO a
instead of:
catchJust :: (Exception -> Maybe b) -> (c -> a) -> c -> (b -> a) -> a
As I'm sure you have gathered from all the answers you can't have the
latter and keep Haskell pure. But there
Graham Klyne wrote:
I have a concern with this, if I understand the issue correctly.
Suppose I have a source module that compiles and runs correctly.
Now suppose I add a restricted (selective) import statement to the file,
explicitly introducing a name that I know does not clash with anything
in
Of course it can. I might do it myself. :)
-- Lennart
Keean Schupke wrote:
I have already asked Simon PJ if this can be implemented in GHC... So if
more people
ask for it, it might get done!
Keean
Lennart Augustsson wrote:
Here is a small puzzle.
-- The following generates a type
Daan Leijen wrote:
Keean Schupke wrote:
No, closed classes are different, here we are talking about lazy
overlap resolution, so
if at _call_ time only one instance fits we choose it. Closing a class
is different.
A "closed class" directive however is an explicit specification that
makes the inte
ECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Marcin 'Qrczak' Kowalczyk
Sent: den 25 november 2004 11:49
To: [EMAIL PROTECTED]
Subject: Re: [Haskell] Real life examples
Lennart Augustsson <[EMAIL PROTECTED]> writes:
An "easy" way to prove it is to provide an equivalent imp
I don't necessarily agree that you can do this trick
in all implementations of Dynamic and Typable.
You're relying on more things than the interface to
Dynamic promises. Your fromDynamic could very well
return Nothing. And should!
But that doesn't matter. The unsafeCast function doesn't
really w
[EMAIL PROTECTED] wrote:
G'day all.
Quoting Lennart Augustsson <[EMAIL PROTECTED]>:
Here is a small puzzle.
You can understand this one because the closed world hypothesis doesn't
apply to type context inference.
I have no problem understanding the technical reason for this.
Ben Rudiak-Gould wrote:
Lennart Augustsson wrote:
> What do you mean when you say the interface is pure?
>
> If your module is really pure then there should be an implemenation
> of it (which could have really bad complexity) with the same observable
> behaviour that uses on
Ben Rudiak-Gould wrote:
Yes it does. :-) If each Haskell environment ships with a correct
implementation of the library, then its interface is the only part that
matters. If the unsafePerformIO hack doesn't work in your new Haskell
compiler, you can replace it with some other magic that does wor
Here is a small puzzle.
-- The following generates a type error:
f :: Char -> Char
f c =
let x = g c
in h x
-- But this definition does not:
f :: Char -> Char
f c =
let x :: Bool
x = g c
in h x
Furthermore, replacing Bool by any other type in the
latter definition will alw
George Russell wrote:
I think their disadvantages are overstated. Glasgow Haskell uses them
lots,
And I bet the implementors wish they hadn't used them as much. ;)
Now we have some weird division of flags into static and dynamic,
for instance. Global (top level) variables can be very convenient,
Adrian Hey wrote:
On Tuesday 23 Nov 2004 9:29 am, Keean Schupke wrote:
myDriver :: (Chan in,Chan out) -> State -> IO State
myDriver (in,out) state = do
-- read commands from in
-- process commands
-- reply on out
myDriver (in,out) new_state
How does this solve the pro
Adrian Hey wrote:
On Tuesday 23 Nov 2004 9:39 am, Lennart Augustsson wrote:
I find it hard to argue these things in the abstract. Could you
post us a (simplified) signature for a module where you are
using top level variables? Maybe that way I can be convinced
that you need them. Or vice versa
Tomasz Zielonka wrote:
On Tue, Nov 23, 2004 at 08:50:45PM -0800, John Meacham wrote:
Atom.hs from ginsu..
This is perhaps the best example, and an incredibly useful piece of code
for anyone struggling with space problems out there.
it provides
data Atom = ... (abstract)
instance Ord Atom
in
[EMAIL PROTECTED] wrote:
No. I mean by the "Haskell language" what is described in
the Haskell 98 Report. unsafePerformIO is not part of the language,
it is a value defined by one of the standard hierarchical libraries.
unsafePerformIO is part of the FFI addendum to the H98 report. So I
think
George Russell wrote:
(3) It needs no extensions to the Haskell language, and only fairly
standard hierarchical libraries like Data.IORef.
It uses unsafePerformIO which is very much an extension to Haskell. :)
-- Lennart
___
Haskell mailing list
[
Adrian Hey wrote:
As for openDevice, if a device should only allow a single open I would
assume this is part of the device driver in the operating system?
(I know this is shifting blame. But I think it shifts it to where it
belongs. In the OS there will be an "open" flag per device.)
IOW there i
Adrian Hey wrote:
But toplevel
things with identity (TWI) are evil as well, *especially* if they are
easy to use.
Just repeating this again and again doesn't make it any more true. Neither
you or any of the other nay-sayers have provided any evidence or credible
justification for this assertion, n
George Russell wrote:
Since it hasn't been mentioned yet I should also point people once
again to "Functional Pearl: Implicit Configurations" by Oleg and
Chung-chieh
Shan, which ingeniously uses polymorphic recursion to construct type
class instances at run time. If there's a safe and sane way t
Jules Bean wrote:
Yes... a lot of the example we have seen here are 'just' handles.
newIORef creates handles. Something many programmers would like is the
ability to create fresh handles at the toplevel...
Yes, I hear what they want. That doesn't mean I think it's
a good idea. Top level things
Keean Schupke wrote:
Adrian Hey wrote:
The first step to solving a problem is to at least recognise
that it exists. What is "bizarre" is that so many folk seem
to be in denial over this. Perhaps you would like to show
me your solution to the "oneShot" problem.
Why are you unable to give a concre
Adrian Hey wrote:
4- They already exist (stdin,stout,stderr) and I don't
recall anybody ever complaining about this.
stdin, stdout, and stderr are not global variables.
They are just handles. One possible implementation
of handles is as an Int. So stdin is no more a global
variable than 0. Of
Adrian Hey wrote:
Why are top level IORefs any worse than other IORefs (for
example)?
Because global variables are just BAD. They have been considered
bad a long time, it's not a Haskell thing.
If you really grok the functional way of doing things there should
be *very*, *very* few times you need
JP Bernardy wrote:
I'd say, check what any primitive 'proves' before
using it. Besides that, calling other functions is ok.
Except for general recursion.
coerce :: a -> b
coerce = coerce
-- Lennart
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.h
I think it's because of tradition. Originally Haskell didn't have
qualified names, only renaming. (Which, IMHO, was a wrong decision
in the original Haskell design.)
-- Lennart
Koen Claessen wrote:
| http://www.haskell.org/hierarchical-modules/libraries/library-design.html
I have always wonde
Hal Daume III wrote:
is there a function, related to getProgName, which returns the (absolute)
path to the current program?
Well, the absolute path name is not necessarily unique, nor is it
guaranteed to exist. :)
-- Lennart
___
Haskell mailing list
[E
I'm not sure what your question means. You can make your
own continuations, so in that sense Haskell has them.
But perhaps you're asking why Haskell lacks something like
call/cc in Scheme which allows you to grab the current
continuation?
This doesn't play very well with graph reduction (which mos
Sean L. Palmer wrote:
class Eq a where
(==) :: a -> a -> Bool
That actually declares a /type class/, not a class. So why the use of
the keyword class? Is it done merely to confuse C++ and Java
programmers? The concept of type class in Haskell apparently roughly
corresponds to the c
Glynn Clements wrote:
What Unicode support?
Simply claiming that values of type Char are Unicode characters
doesn't make it so.
Just because some implementations lack toUpper etc. doesn't mean
they all do. Hbc has had those implemented for maybe 10 years.
-- Lennart
__
rui yang wrote:
Suppose I have a function:
funcmap :: a->b->c
can I use type synonyms to describe a new type like this:
Type Funcmap = a->b>c ?
First, it's 'type' not 'Type'.
Second, you want '->' not '>'.
Third, all type variables in the RHS must be on the LHS.
So, we get
type Funcmap a b c
t positive float?
On Tue, 21 Oct 2003, Lennart Augustsson wrote:
So this has been a while, but i think that decodeFloat,
incrementing the mantissa, encodeFloat might work.
But then again, it might not. :)
-- Lennart
Hal Daume III wrote:
My preference would be for succ (+-0) to return the smalles
So this has been a while, but i think that decodeFloat,
incrementing the mantissa, encodeFloat might work.
But then again, it might not. :)
-- Lennart
Hal Daume III wrote:
My preference would be for succ (+-0) to return the smallest positive
real, since then you could define succ x to be the uniq
Derek Elkins wrote:
If I'm not mistaken, the Report restricts main's type to be, at least,
IO a. Anyways, it's perfectly sensible to return anything. The RTS
simply discards it. The above example as an entire program is an IO
action that returns an IO action that is discarded by the RTS.
You're
Alastair Reid wrote:
Another question with a trivial answer, what is the result of:
main :: IO (IO ())
main = return (putStr "Hello World!")
It is a computation which, if executed, will print "Hello World"
Clearly it also shows the relation between IO and chosen evaluation
strategy.
This
This really sounds a lot like home work. :)
-- Lennart
Fredrik Petersson wrote:
hi again... :)
Ok assume i got this list of tuples [(10,1),(20,2),(30,3)]
where i in (i,j) is a index,
i want to go through the list and add a number witch matches the best index.
Like 18 should give me [(10,1),(
Simon Marlow wrote:
Simon P.J. writes:
... So it's reasonable that there should be some language extension.
I'm just looking for the minimal such extension.
unsafeCoerce# is quite a minimal extension :-)
It's a minimal extension, but it's not an extension that provides any
insight. :)
Use the Prelude function realToFrac.
-- Lennart
Mike T. Machenry wrote:
Hello,
I am having a problem. I recently desided I wanted a bunch function to return
float instead of Int. I changed their type and wrote a new function that
returned a float. I figured it'd be okay if all the others st
Shae Matijs Erisson wrote:
The following message is a courtesy copy of an article
that has been posted to comp.lang.functional as well.
In the spirit of http://ioccc.org/
Bring us your poor, weary, downtrodden, and unreadable source code.
Come to the 0th INTERNATIONAL OBFUSCATED HASKELL C
Yes, I totally agree. The current time library is pretty broken.
-- Lennart
John Meacham wrote:
yes! I was just wrestling with this yesterday. I finally gave up and
looked inside ghc's (TOD Integer Integer) directly because the Time
library as it currently stands is somewhat less than usefu
1 - 100 of 377 matches
Mail list logo