| Where typeApp splits a type to find its constructor, ctorTypes gets
| the types of the fields, and dataCtors gets the constructors in a data
| type. Unfortunately reify doesn't seem to work on types. Is it
| possible to do what I am after?
reify takes a Name, not a Type. Perhaps you mean that
Yes, I'm afraid that you are understanding correctly. Annoying isn't it.
It is well-known (among Haskell mathematicians at least) that the numeric type
classes in the prelude are broken.
Here's one proposal for a small step in the right direction:
Hi Simon,
On 6/4/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
| Where typeApp splits a type to find its constructor, ctorTypes gets
| the types of the fields, and dataCtors gets the constructors in a data
| type. Unfortunately reify doesn't seem to work on types. Is it
| possible to do what
I've extended the what to look for if your build fails section in
http://hackage.haskell.org/trac/ghc/wiki/Building/Windows
Please do keep adding to this page! Every time you trip over something, think
about whether your experience could be used to help someone else.
Simon
|
| lot of elements in it. Having to do an explicit declaration of deriving
| (Data,Typeable) for each of them is just a tremendous beat-down no
| matter where I do it.
I hate to see you beaten down, Alex. Make a feature request. I don't want to
make promises, but having a well-specified
Hi
On 6/1/07, Alex Jacobson [EMAIL PROTECTED] wrote:
I suppose a deriveAll command from template haskell would work. Is that
really possible?
Asking people who have more knowledge of template haskell, I'm still not sure.
What it would really rely on is:
getDataDeclarationsInCurrentModule
On Mon, 2007-06-04 at 09:43 +0100, Alistair Bayley wrote:
After some expriments with the simplifier, I think I have a portable
version of a direct-from-buffer decoder which seems to perform nearly
as well as one written directly against GHC primitive unboxed functions.
I'm wondering if
Hello Duncan,
Monday, June 4, 2007, 2:25:10 PM, you wrote:
- the chr function tests that its Int argument is less than 1114111,
before constructing the Char. It'd be nice to avoid this test.
use unsafeChr or, for portability, smth like this:
#ifdef GHC
import GHC.Exts (unsafeChr)
#else
Felipe Almeida Lessa wrote:
On 5/31/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
You don't need to feel too bad about this:
[snip]
Don't worry, I should have googled anyway =).
BTW, how do you usually proceed when finding out why your code said
Segmentation fault.? (should this question move
Marc Weber wrote:
You can download the modified version from
http://mawercer.de/marcweber/hasktags.hs
care to send us a patch?
Cheers,
Simon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I suppose a deriveAll command from template haskell would work. Is that
really possible?
Asking people who have more knowledge of template haskell, I'm still not sure.
What it would really rely on is:
getDataDeclarationsInCurrentModule :: Q [Dec]
Whether that can be done or not is still not
On 04/06/07, Duncan Coutts [EMAIL PROTECTED] wrote:
On Mon, 2007-06-04 at 09:43 +0100, Alistair Bayley wrote:
After some experiments with the simplifier, ...
The portable unboxed version is within about 15% of the unboxed version
in terms of time and allocation.
Well done.
Of course, that
On Mon, 2007-06-04 at 13:12 +0100, Alistair Bayley wrote:
BTW, what's the difference between the indexXxxxOffAddr# and
readXxxxOffAddr# functions in GHC.Prim?
Right. So it'd only be safe to use the index ones on immutable arrays
because there's no way to enforce sequencing with
Hello all,
I have an implementation question that I hope someone can help out
with. Say I have a fixed-size list: [1, 2, 3, 4, 5] that I want to
treat as circular in a function in order to rotate one of the
elements n positions. So rotating the second element 2 positions
would result
On Sun, 3 Jun 2007, bretm wrote:
I just got started learning Haskell a few days ago. I've implemented a
numeric data type that can represent some irrational numbers exactly, and
I'd like to instantiate the RealFrac class so I can do truncate, round,
etc., in the most natural way in the
Hello,
I am a somewhat experienced programmer and a complete Haskell newbie, so I
hope this is the correct ML for my question.
I have decided to learn Haskell and started with Graham Hutton's book.
Everything was going nicely until section 8.4, on sequencing functional
parsers. I am trying to
On 6/4/07, Juozas Gaigalas [EMAIL PROTECTED] wrote:
Hello,
I am a somewhat experienced programmer and a complete Haskell newbie, so I
hope this is the correct ML for my question.
I have decided to learn Haskell and started with Graham Hutton's book.
Everything was going nicely until section
On 04/06/07, Alfonso Acosta [EMAIL PROTECTED] wrote:
Hugs is probably complaining because it identifies x - item (which
is not a simple expression) as the last element of do.
That was my first guess, too, but it's not the case, switch to a
monospaced font to see this.
Juozas, you could only
Hi Juozas,
-
type Parser a = String - [(a, String)]
return :: a - Parser a
return v = \inp - [(v, inp)]
failure :: Parser a
failure = \inp - []
item :: Parser Char
item = \inp - case inp of
[] - []
(x:xs) - [(x, xs)]
parse
(this time include the list, too)
-- Forwarded message --
From: Alistair Bayley [EMAIL PROTECTED]
Date: 04-Jun-2007 16:13
Subject: Re: [Haskell-cafe] Optimising UTF8-CString - String
marshaling, plus comments on withCStringLen/peekCStringLen
To: Duncan Coutts [EMAIL PROTECTED]
Awesomely complete response. Thank you.
Henning Thielemann wrote:
There are several things that are inconvenient in the numeric part of
Haskell 98 Prelude. As always I suggest a look at alternative numeric
class hierarchies, like NumericPrelude:
DavidA-2 wrote:
Yes, I'm afraid that you are understanding correctly. Annoying isn't it.
It is well-known (among Haskell mathematicians at least) that the numeric
type
classes in the prelude are broken.
Here's one proposal for a small step in the right direction:
On Mon, 4 Jun 2007, bretm wrote:
Henning Thielemann wrote:
Is your approach more like symbolic calculation or more like a
representation for computable reals?
http://www.haskell.org/haskellwiki/Applications_and_libraries/Mathematics#Number_representations
Computable reals,
Bulat Ziganshin wrote:
it seems that now we move right into this direction with GPUs
I was just thinking that GPUs might make a good target for a reduction
language like Haskell. They are hugely parallel, and they have the
commercial momentum to keep them current. It also occurred to me that
On 6/4/07, DavidA [EMAIL PROTECTED] wrote:
Yes, I'm afraid that you are understanding correctly. Annoying isn't it.
It is well-known (among Haskell mathematicians at least) that the numeric type
classes in the prelude are broken.
A few days ago I found myself forced to write:
instance
David House wrote:
Juozas, you could only use do-notation if your Parser type were
declared an instance of the Haskell type-class Monad. Seeing as you
haven't done this, you have to stick to the de-sugared version
involving (=) and return:
Is this true? I thought do (like all sugar) was
I would think a simple cyclic list should work without any copying at all:
rotateList myList n = take m . drop n $ x
where x = myList ++ x
m = length myList
Just keep dropping elements to rotate.
A possible alternative is to use a more tailored data structure with a
zipper. See
Dan Weston wrote:
Is this true? I thought do (like all sugar) was desugared before
semantic analysis. So long as you have the right =, return, and fail
in scope, I would have thought the desugaring is oblivious to their
definition (and particularly ignorant of instancing of the Monad
On 6/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
The last time I tried this code, I reported to haskell-cafe that
OOHaskell does not work when compiled as a library (at least under
GHC). For some reason the code that uses OOHaskell had to be compiled
along side it. Is this now fixed?
All these smart math guys hanging around and nobody's given a really
decent answer to this?
It's actually not arbitrary. There's a strong connection between
predicates (functions that return boolean values) and sets. Any
predicate uniquely determines a set - the set of values for which it
I'm collecting links to documents describing some of GHC's
optimisation output flags, like -ddump-hi and -ddump-simpl. I'll add
stuff to this wiki page:
http://www.haskell.org/haskellwiki/Performance/GHC
So far I've found little bits in the GHC manual, like:
4.16.3. How to read Core syntax
Hi
4.16.3. How to read Core syntax
http://www.haskell.org/ghc/docs/latest/html/users_guide/options-debugging.html#id3130643
I found that -ddump-simpl gives you good information, in a readable
form - I much prefer it to reading the .hcr files.
Thanks
Neil
Arie Peterson writes:
There are two things one typically wants to do when working with a
substructure of some larger data structure: (1) extract the
substructure; and (2) change the larger structure by acting on the
substructure. A 'Ref cx t' encodes both of these functions (for a
On 火, 2007-6月-05, at 02:54, Greg Fitzgerald wrote:
rotating the fourth element 2 positions would result in: [1, 2,
4, 3, 5]
Seems odd. Should that be [4,1,2,3,5]?
Yes, I meant to use the 5 element in my second example. Sorry for
the confusion.
Is there an idomatic way to handle both
| data Ref cx t
| = Ref
| {
| select :: cx - t
| , update :: (t - t) - cx - cx
| }
|
| A Ref is a bit like a typed and composable incarnation of apfelmus's
| indices, or a wrapper around Tillmann's change* functions, containing
| not only a setter but also the accompanying
HaskellyCaffeinated,
i noticed that there was a JavaMonad lib kicking around on the web, but all
the links i can find are stale. Does anybody have a live pointer to this
lib?
Best wishes,
--greg
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
505 N 72nd St
Seattle, WA 98103
+1
David Menendez wrote:
| That's a neat idiom. I wonder how far one could usefully generalize it.
|
| For example,
|
| type Ref cx t = forall f. Functor f = (t - f t) - cx - f cx
|
| newtype Id a = Id { unId :: a }
| instance Functor Id where fmap f = Id . f . unId
|
| newtype K t a
example:
data A = A INt
| B [A]
instace Arbitrary A where
arbitrary = oneof [ liftM A arbitrary
, liftM B arbitrary
]
But now QuickCheck will propably create a test value
A ( B [ A ( B [ A - no end
Is there an easy QuickCheck way to prevent
Marc Weber wrote:
data A = A INt
| B [A]
instace Arbitrary A where
arbitrary = oneof [ liftM A arbitrary
, liftM B arbitrary
]
But now QuickCheck will propably create a test value
A ( B [ A ( B [ A - no end
Is there an easy QuickCheck way
I would like to know if all 16 possible functions that accept two
boolean arguments have names in First-Order Logic. I know they have
Haskell function names (e.g. \p - \_ - id p, \_ - \_ - const True),
but I'm hoping there is a more general name that is recognised by anyone
with a feel for logic,
Hi
BAE Systems which specialises in military technology is looking for
programmers who have experience in C, C++ and Java and UML. Where
soundness and completeness but especially soundness is of the essence
the OOP framework is far from ideal.
The FP paradigm, on the other hand, offers the
On Tue, Jun 05, 2007 at 02:41:48PM +1000, Tony Morris wrote:
I would like to know if all 16 possible functions that accept two
boolean arguments have names in First-Order Logic. I know they have
Haskell function names (e.g. \p - \_ - id p, \_ - \_ - const True),
but I'm hoping there is a more
Scott Brickner wrote:
It's actually not arbitrary.
[...]
A ≤ B iff A ⊆ B
A ⊆ B iff (x ∊ A) ⇒ (x ∊ B)
Alternatively and dually but equally naturally,
A ≥ B iff A ⊆ B iff (x ∊ A) ⇒ (x ∊ B)
and then we would have False True.
Many of you are platonists rather than formalists; you have a
On Tue, 2007-06-05 at 01:16 -0400, Albert Y. C. Lai wrote:
Scott Brickner wrote:
It's actually not arbitrary.
[...]
A ≤ B iff A ⊆ B
A ⊆ B iff (x ∊ A) ⇒ (x ∊ B)
Alternatively and dually but equally naturally,
A ≥ B iff A ⊆ B iff (x ∊ A) ⇒ (x ∊ B)
and then we would have False True.
Hello
What do the ⤠symbols represent?
Thanks,
Paul
At 06:21 05/06/2007, you wrote:
On Tue, 2007-06-05 at 01:16 -0400, Albert Y. C. Lai wrote:
Scott Brickner wrote:
It's actually not arbitrary.
[...]
A ⤠B iff A â B
A â B iff (x â A) â (x â B)
Alternatively and dually but
45 matches
Mail list logo