On Mon, Jun 6, 2011 at 01:52, Yitzchak Gale g...@sefer.org wrote:
Scott Lawrence wrote:
You almost never want to use UndecidableInstances
when writing practical programs in Haskell.
Ah. That's what I wanted to know :P
(Although it does seem to me - from looking around docs and the source
-
Oops. I can just abandon the Entropy typeclass and put the function
directly into Model, eh? Yeah, I think I'll do that...
Supposing I didn't want to - any alternatives? Other instances of
Entropy I might consider:
instance (Eq a) = Entropy [a]
instance (Eq a) = Entropy (Tree a)
On Mon, Jun
On Mon, Jun 6, 2011 at 7:52 AM, Yitzchak Gale g...@sefer.org wrote:
Scott Lawrence wrote:
More specifically, I have
class Model m a | m - a where ...
class Entropy d where ...
instance (Model m a) = Entropy m where ...
The first line requires MultiParamTypeClasses and
Scott Lawrence wrote:
I'm modelling text in a markov-model-like way. I have an actual markov
model (albeit one in which X_n depends on a fixed range X_n-1 ..
X-n-k). I'm vaguely anticipating the presence of other models:
class Model m a | m - a where
lexemes :: m - Set a
genFunc :: m
On 06/06/2011 02:57 AM, Yitzchak Gale wrote:
Generally, we don't start out with a type class. Type classes are
great for the special situations in which they are needed (although
you can do pretty well without them even then), but first
let's get the basic concepts.
Perhaps a model is just
I wrote:
You almost never want to use UndecidableInstances
when writing practical programs in Haskell.
When GHC tells you that you need them, it almost
always means that your types are poorly designed,
usually due to influence from previous experience
with OOP.
Gábor Lehel wrote:
Are you
On 06/06/2011 03:13 AM, Scott Lawrence wrote:
I still don't know enough details about what you're doing,
so my types are probably off. But I hope you get the idea.
No, your types are right.
Or not.
type Model a = (Ord a) = Set a -- the set of lexemes
- [a] -- the
Scott Lawrence wrote:
But... this prevents me from storing more information in a Model in the
future. While I don't really anticipate needing too (I can see this
function covering all likely use cases), it does seem sorta restrictive.
I tend not to think about storing information inside of
Are casts required to run the code below?
If so why?
Thanks,
Pat
-- Idetifiers for objects
class (Integral i) = IDs i where
startId :: i
newId :: i - i
newId i = succ i
sameId, notSameId :: i - i - Bool
-- Assertion is not easily expressible in Haskell
-- notSameId i newId i = True
sameId
it won't be a pleasant choice to fork over a good chunk of money to
Apple for the use of free software that they didn't develop.
Whilst I acknowledge your painful situation, I'd like to rebut the idea that
Apple stole someone else's free software and are selling it on. In fact, Apple
On Mon, Jun 6, 2011 at 7:52 AM, Yitzchak Gale g...@sefer.org wrote:
You almost never want to use UndecidableInstances
when writing practical programs in Haskell.
Surprisingly enough, mtl uses UndecidableInstances, so almost every
practical Haskell program uses it in one way or another.
G
--
Scott Lawrence wrote:
type Model a = (Ord a) = Set a -- the set of lexemes
- [a] -- the original text to model
- [a] -- list of previous lexemes
- ProbDist a -- the next lexeme
and then
entropy :: Model a - Set a -
Gregory Collins wrote:
Surprisingly enough, mtl uses UndecidableInstances, so almost every
practical Haskell program uses it in one way or another.
The library uses it, you don't use it directly in your program.
Anyway, transformers does the job when you need to
build on the basic monad
Chris Smith wrote:
I had to abandon a plan
to introduce Haskell in a class I taught this past semester
[12 to 13 years old] because of issues with getting it
installed on the Macintosh laptops that some of
the students had.
Truth is, you obviously don't need support for FFI development
in
On 4/06/2011, at 5:12 AM, Andrew Coppin wrote:
I'm curious to know why anybody thought that -- was a good comment marker
in the first place. (I'm curious because Haskell isn't the only language to
have made this strange choice.)
Indeed. The Wikipedia lists
Euphoria, Haskell, SQL, Ada,
This whole discussion is reminding me of Wadler's Law of Language
Design [1], it's nice to see that in 15 years things haven't changed
much!
WADLER'S LAW OF LANGUAGE DESIGN
In any language design, the total time spent discussing
a feature in this list is proportional to two raised to
On 6/06/2011, at 8:11 AM, Chris Smith wrote:
That's interesting... whatever the reason, though, I concur that using
Haskell seems much easier on Linux and Windows. I had to abandon a plan
to introduce Haskell in a class I taught this past semester because of
issues with getting it installed
I always forget to reply all. Silly gmail.
On Mon, Jun 6, 2011 at 2:07 AM, Ryan Ingram ryani.s...@gmail.com wrote:
Hi Pat. There aren't any casts in that code. There are type annotations,
but this is different than the idea of a cast like in C.
For example
((3 :: Integer) :: Int)
is
On Montag, 6. Juni 2011, 09:45, Patrick Browne wrote:
Are casts required to run the code below?
If so why?
Thanks,
Pat
-- Idetifiers for objects
class (Integral i) = IDs i where
startId :: i
newId :: i - i
newId i = succ i
sameId, notSameId :: i - i - Bool
-- Assertion is not
Hi Patrick,
On 06/06/2011 09:45 AM, Patrick Browne wrote:
Are casts required to run the code below?
If so why?
Thanks,
Pat
-- Idetifiers for objects
class (Integral i) = IDs i where
startId :: i
newId :: i - i
newId i = succ i
sameId, notSameId :: i - i - Bool
-- Assertion is not
On 6 June 2011 02:34, KQ qu...@sparq.org wrote:
The shock here is that there was only one failure, whereas the False ~=?
True should have failed.
I'm not sure, but at a glance it looks you might have the usual
problem where compiling your test with optimisations means that GHC
optimises away
On Montag, 6. Juni 2011, 11:08, Ryan Ingram wrote:
Hi Pat. There aren't any casts in that code. There are type
annotations, but this is different than the idea of a cast like in C.
For example
((3 :: Integer) :: Int)
is a compile error.
What you are seeing is that 3 has
Nicolas Wu schrieb:
This whole discussion is reminding me of Wadler's Law of Language
Design [1], it's nice to see that in 15 years things haven't changed
much!
WADLER'S LAW OF LANGUAGE DESIGN
In any language design, the total time spent discussing
a feature in this list is
I would be fantastic if XCode wasn't a dependency. As well as the
inconvenience it also weighs in at around 5G (IIRC) of space which is
still somewhat significant.
Not to detract at all from the work of the wonderful GHC and Haskell
Platform contributors in any way. For me it would just make it
On Mon, 2011-06-06 at 08:51 +0100, Malcolm Wallace wrote:
In paying for XCode 4, you are getting a lot of proprietary code in addition
to gcc.
True... but not *using* it.
However, XCode 3 remains free to download, if you are a registered Apple
developer. Registration is completely free of
On 6 Jun 2011, at 13:49, Lyndon Maydwell wrote:
I would be fantastic if XCode wasn't a dependency. ...
Not to detract at all from the work of the wonderful GHC and Haskell
Platform contributors in any way. For me it would just make it that
much easier to convince mac-using friends to give
From: Chris Smith cdsm...@gmail.com June 6, 2011 8:58 AM
On Mon, 2011-06-06 at 08:51 +0100, Malcolm Wallace wrote:
In paying for XCode 4, you are getting a lot of proprietary code in
addition to gcc.
True... but not *using* it.
However, XCode 3 remains free to download, if you are a
Isn't gcc just used for its assembler and object file creation, these days,
now that via-C is deprecated? Or are there other parts of it that are
needed?
On Mon, Jun 6, 2011 at 10:47 AM, Malcolm Wallace malcolm.wall...@me.comwrote:
On 6 Jun 2011, at 13:49, Lyndon Maydwell wrote:
I would be
On 06/06/11 15:57, Daniel Peebles wrote:
Isn't gcc just used for its assembler and object file creation, these
days, now that via-C is deprecated? Or are there other parts of it that
are needed?
The C compiler is needed to support foreign export and foreign import
wrapper, and we also
On 06/06/2011 10:23, Max Bolingbroke wrote:
On 6 June 2011 02:34, KQ qu...@sparq.org wrote:
The shock here is that there was only one failure, whereas the False ~=?
True should have failed.
I'm not sure, but at a glance it looks you might have the usual
problem where compiling your test
I'm writing an optimisation routine using Uniplate. Unfortunately, a
sub-function I'm writing is getting caught in an infinite loop because
it doesn't return Nothing when there are no optimisations left.
I'd like a way to move the last Just into f, but this makes recursion
very messy. I was
On 6 June 2011 16:18, Jimbo Massive jimbo.massive-hask...@xyxyx.org wrote:
Or is this bad behaviour due to HUnit doing something unsafe?
I think it may be related to this bug:
http://hackage.haskell.org/trac/ghc/ticket/5129
The suggested fix is to change HUnit to define assertFailure with
On 6 June 2011 16:43, Max Bolingbroke batterseapo...@hotmail.com wrote:
The suggested fix is to change HUnit to define assertFailure with
throwIO, but the latest source code still uses throw:
Err, I mean
http://hackage.haskell.org/packages/archive/HUnit/latest/doc/html/src/Test-HUnit-Lang.html
That sounds very applicable to my issue (and unfortunately my googling missed
this, ergo my consult of haskell-cafe uberwissenmensch). When I again have
access to the aforementioned Mac this evening I'll try both disabling
optimizations and a tweaked HUnit to see if that resolves the problem
On Sun, Jun 05, 2011 at 12:51:47PM -0700, KC wrote:
If new intermediate classes crop up then there would be no point in fixing
class (Applicative m) = Monad m where
since it would have to be changed if new intermediate classes are
found.
There actually is at least one intermediate class
The dtd-text package[1] provides a parser and renderer for XML
DTDs. It implements most of the parts of the W3C XML specification
relating to DTDs, and is compatible with versions 1.0 and 1.1 of the
specification.[2] The parser and renderer operate on Haskell DTD
objects from the dtd-types[3]
I wrote:
I really should have edited the Cabal description of this package
before I uploaded it.
Max Rabkin wrote:
Could you upload a bugfix version with an accurate description? This
could be very frustrating to a random hackage-brower who hasn't read
the announcement (or me, in a few
Bearing in mind that the characters that have been used to begin
end of line comments include *, /, ;, !, #, %, and $, it's not
clear that there's anything _that_ regrettable about -- .
Recall that the problem is not with isolated characters, but whole strings.
-- a is a comment, --a is a
On Sun, Jun 5, 2011 at 11:00 AM, Yitzchak Gale g...@sefer.org wrote:
If behind the scenes the concat is copying directly from slices of the
original
input, then no, in principle we're not saving much then.
I thought there were *two* copies going on.
If you're using the specialised functions
On Mon, Jun 6, 2011 at 9:19 AM, Brent Yorgey byor...@seas.upenn.edu wrote:
On Sun, Jun 05, 2011 at 12:51:47PM -0700, KC wrote:
If new intermediate classes crop up then there would be no point in fixing
class (Applicative m) = Monad m where
since it would have to be changed if new
On Montag, 6. Juni 2011, 19:08, Albert Y. C. Lai wrote:
Bearing in mind that the characters that have been used to begin
end of line comments include *, /, ;, !, #, %, and $, it's not
clear that there's anything _that_ regrettable about -- .
Recall that the problem is not with isolated
On 2011-06-06 13:08 -0400, Albert Y. C. Lai wrote:
Recall that the problem is not with isolated characters, but whole strings.
[...]
in LaTeX, %%@#$^* is a comment.
This example probably does not help your position.
Since (La)TeX allows the comment character to be changed at any time,
the
On 2011-06-06 13:39 -0400, Nick Bowler wrote:
On 2011-06-06 13:08 -0400, Albert Y. C. Lai wrote:
Recall that the problem is not with isolated characters, but whole strings.
[...]
in LaTeX, %%@#$^* is a comment.
This example probably does not help your position.
Since (La)TeX allows the
On 11-06-06 01:34 PM, Daniel Fischer wrote:
On Montag, 6. Juni 2011, 19:08, Albert Y. C. Lai wrote:
Recall that the problem is not with isolated characters, but whole
strings.
-- a is a comment, --a is a comment, but ---a is not.
It is. Report, section 2.3:
Sorry. Then --| is not a
On Mon, Jun 6, 2011 at 16:47, Malcolm Wallace wrote:
The ghc team already bundle a copy of gcc in their Windows distribution,
precisely because it can be fiddly to get a working copy of gcc for that
platform otherwise. I wonder if they would consider the possibility of
shipping gcc on Mac
On Monday 06 June 2011, 19:51:44, Albert Y. C. Lai wrote:
On 11-06-06 01:34 PM, Daniel Fischer wrote:
On Montag, 6. Juni 2011, 19:08, Albert Y. C. Lai wrote:
Recall that the problem is not with isolated characters, but whole
strings.
-- a is a comment, --a is a comment, but ---a is
On Mon, 2011-06-06 at 23:38 +0800, Lyndon Maydwell wrote:
I'm writing an optimisation routine using Uniplate. Unfortunately, a
sub-function I'm writing is getting caught in an infinite loop because
it doesn't return Nothing when there are no optimisations left.
I'd like a way to move the
Back to Haskell: I agree, the choice of the comment delimiter was not the
best in light of the possibility to define operators containing it as a
substring. But changing it to have --| start a comment too might break
too much code (and eliminating -- as a comment starter would certainly
break
On Mon, Jun 6, 2011 at 12:19 PM, Brent Yorgey byor...@seas.upenn.edu wrote:
The idea is that Applicative computations
have a fixed structure which is independent of intermediate results;
Monad computations correspond to (potentially) infinitely branching
trees, since intermediate results
(missed including cafe)
f :: [Modification] - Maybe [Modification]
and
f _ = Just $ f ...
are incompatible
I managed to get the behaviour I'm after with the use of Either, but
this really is messy:
-- Sets of changes
o (Modifier (Changes []) i) = Just $ i
o (Modifier (Changes [c]) i) = Just $
On Tue, 2011-06-07 at 04:09 +0800, Lyndon Maydwell wrote:
(missed including cafe)
f :: [Modification] - Maybe [Modification]
and
f _ = Just $ f ...
are incompatible
My bad:
f ... = let cs' = (Rotate (x+x') : fromMaybe cs (f cs))
in fromMaybe cs (f cs)
Or refactoring it:
g l =
Am 23.05.2011 13:32, schrieb Simon Marlow:
On 18/05/2011 19:22, Jason Dagit wrote:
On Wed, May 18, 2011 at 2:50 AM, John Sneerjohnsn...@operamail.com
wrote:
Hello all,
I know it is not probably good question to this list, but anyway,
could anyone point me to some more detailed how to
Thanks Maciej!
An additional Just was required in the refactored version of f:
f (Rotatex : Rotatex': cs) = Just $ g (Rotate (x+x') : g cs)
This is much cleaner than what I was doing.
On Tue, Jun 7, 2011 at 4:14 AM, Maciej Piechotka uzytkown...@gmail.com wrote:
On Tue,
Those are definitely valid concerns. Has anyone made a wiki-like site with
Yesod? I hadn't heard of Yesod until I joined this mailing list, but I've
seen quite a bit of buzz around it since then. If a large enough chunk of
the community is backing a framework and focusing on making it secure
Hi Lyndon
Are you just coalescing adjacent elements (if they are the same constructor)?
As it seems you have a list here rather than a tree, I'd step out of
Uniplate at this point and just do a list traversal with direct
recursion.
___
Haskell-Cafe
On Mon, Jun 6, 2011 at 3:39 PM, Casey McCann syntaxgli...@gmail.com wrote:
On Mon, Jun 6, 2011 at 12:19 PM, Brent Yorgey byor...@seas.upenn.edu wrote:
The idea is that Applicative computations
have a fixed structure which is independent of intermediate results;
Monad computations correspond to
I'm trying to write a rolling window variation of the adler32 hash
function (here: https://gist.github.com/1011151), and I got it to a
nearly acceptable speed under ghc 6.12.3 (~35MB/s on my work machine),
so I thought I'd see how the new ghc 7.0.3 treated it. The answer is
not good. I get about
On Mon, Jun 6, 2011 at 4:45 PM, Greg Weber g...@gregweber.info wrote:
Gitit uses darcs or git to store data, but through the command line
interfaces. Unfortunately to my knowledge darcs does not expose a library
interface. Gitit could be made faster and more secure by interfacing with
Right now, I'd just like to have the code run
quickly, and to figure out why I'm seeing such a terrible regression
under ghc7.
From the #haskell channel, it looks like the horrible speed issue on
this code is specific to my system. I'm re-building ghc7 now
(bootstrapping ghc7 with ghc7
On Mon, Jun 6, 2011 at 5:32 PM, Matthew Steele mdste...@alum.mit.edu wrote:
I think Branching is to Monad what ArrowChoice is to ArrowApply.
Branching allows the shape of the computation to depend on run-time
values (which you can't do with Applicative), but still allows only a
finite number
From the #haskell channel, it looks like the horrible speed issue on
this code is specific to my system. I'm re-building ghc7 now
(bootstrapping ghc7 with ghc7 instead of ghc6), so maybe that will
make something happier.
FWIW, rebuilding ghc7 using ghc7 as the bootstrapping implementation
On 7 June 2011 10:12, tsuraan tsur...@gmail.com wrote:
From the #haskell channel, it looks like the horrible speed issue on
this code is specific to my system. I'm re-building ghc7 now
(bootstrapping ghc7 with ghc7 instead of ghc6), so maybe that will
make something happier.
FWIW,
On Mon, Jun 6, 2011 at 4:49 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote:
On 6/06/2011, at 8:11 AM, Chris Smith wrote:
That's interesting... whatever the reason, though, I concur that using
Note that the price for XCode applies to *XCode*.
It's not a price for *GCC*.
Having XCode, I was
On Mon, Jun 6, 2011 at 1:34 PM, Nicu Ionita nicu.ion...@acons.at wrote:
Am 23.05.2011 13:32, schrieb Simon Marlow:
On 18/05/2011 19:22, Jason Dagit wrote:
On Wed, May 18, 2011 at 2:50 AM, John Sneerjohnsn...@operamail.com
wrote:
Hello all,
I know it is not probably good question to
Oh, you built with ghcquickbuild? I don't remember the details, but
if memory serves it disables a lot of optimisations, etc. just to get
GHC built quicker to test that it compiles. So you probably don't
want that ;-)
That's good to know. It's too bad there doesn't seem to be a warning
in
I got asked a question today about why Control.Applicative is labeled as
experimental on Hackage. Perhaps that field is something of a failed
experiment, and it remaining there is likely to confuse people.
Just a thought... not sure of the best place to mention it.
--
Chris Smith
On 6/6/11 1:52 AM, Yitzchak Gale wrote:
You almost never want to use UndecidableInstances
when writing practical programs in Haskell.
When GHC tells you that you need them, it almost
always means that your types are poorly designed,
usually due to influence from previous experience
with OOP.
67 matches
Mail list logo