On 12 March 2013 13:18, Roman Cheplyaka r...@ro-che.info wrote:
Is there a way to newtype a constraint?
Imagine a type class parameterised over constraints. What do I do if I
want multiple instances for (essentially) the same constraint?
It would make sense to add support for this to newtype
On 25 January 2013 14:46, Ozgur Akgun ozgurak...@gmail.com wrote:
The latest versions of ansi-terminal and hspec do not work together. Cabal
picks the latest ansi-terminal (0.6) first, then the latest hspec that
doesn't conflict with this choice is 0.3.0.
If this happens because the dependency
On 2 November 2011 01:08, Diego Souza dso...@bitforest.org wrote:
The idea is simple: there are many different platforms that would be
to expensive for one to support. So they ask the community for help,
and then distribute the load amongst the perl community.
Duncan and co have been working
On 2 November 2011 07:42, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
How to avoid the name changing?
Maybe you should use nameBase rather than show?
Max
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On 1 November 2011 09:00, Ketil Malde ke...@malde.org wrote:
This is where it stranded the last time, IIRC. That sentiment makes me
a bit uneasy; so you are the official maintainer of a package on
Hackage, but you do not want to hear about it when it fails to compile?
Don't forget that some
On 1 November 2011 10:14, Ketil Malde ke...@malde.org wrote:
So, I'd *love* to get an email when my packages fail to build, but I will
accept that other people have a more sensitive relationship with their
inbox. (I assume that the people who raise this objection - Max
and Yitzchak - belong
On 23 October 2011 06:48, Adam Megacz meg...@cs.berkeley.edu wrote:
The title might be a bit more provocative than necessary.
I'm starting to suspect that there are very useful aspects of the
parametricity of System F(C) which can't be taken advantage of by Haskell in
its current state. To
On 18 October 2011 02:17, bob zhang bobzhang1...@gmail.com wrote:
But I found a problem which I thought would be made better, plz correct
me if I am wrong
For those who only subscribe to Haskell-Cafe, Bob posted a very
similar thread to ghc-users, which I replied to here with a suggestion
On 26 September 2011 01:37, Nicu Ionita nicu.ion...@acons.at wrote:
1. how can the compiler (here ghc) know which function to expose as the
correct generic search function? There must be two search functions
generated, one generic and its specialization.
Yes, exactly. If you have:
{-#
On 5 September 2011 02:38, Sebastian Fischer fisc...@nii.ac.jp wrote:
These are important questions. I think there is a trade-off between
supporting many cases and having a simple desugaring. We should find a
sweet-spot where the desugaring is reasonably simple and covers most
idiomatic cases.
On 5 September 2011 08:35, Max Bolingbroke batterseapo...@hotmail.com wrote:
(If you do want to support the type checker only generating requests
for an Applicative constraint you could just insist that user code
writes pure instead of return, in which case this would be quite
easy
On 26 August 2011 13:52, Sergiy Nazarenko nazarenko.ser...@gmail.com wrote:
/usr/local/lib/ghc-6.12.3/base-4.2.0.2/libHSbase-4.2.0.2.a(Conc__270.o):
relocation R_X86_64_32 against
`base_GHCziConc_ensureIOManagerIsRunning1_closure' can not be used when
making a shared object; recompile with
On 11 August 2011 05:17, John Millikin jmilli...@gmail.com wrote:
This is just a quick package I whipped up out of frustration with
test-framework scrolling an error message out of sight, for the
millionth time.
Patches to make test-framework less noisy (either by default or with a
flag) will
On 11 August 2011 15:49, John Millikin jmilli...@gmail.com wrote:
I tried, actually, but couldn't figure out how to separate running the
test from printing its output. All the attempted patches turned into
huge refactoring marathons.
Just FYI test-framework already has exactly this split
On 7 August 2011 06:15, Chris Yuen kizzx2+hask...@gmail.com wrote:
I am mainly interested in making the Haskell version perform
comparatively to the C# version. Right now it is at least 5x slower so
obviously I am missing something obvious)
You have a map call which is immediately consumed by
On 4 July 2011 16:44, Logo Logo sarasl...@gmail.com wrote:
Hi,
For the following error:
Stack space overflow: current size 8388608 bytes.
Use `+RTS -Ksize -RTS' to increase it.
I want to find out the culprit function and rewrite it tail-recursively. Is
there a way to find out which
On 28 June 2011 17:50, Gracjan Polak gracjanpo...@gmail.com wrote:
It seems I'm not allowed to open same file both for writing and for reading:
This behaviour is part of the Haskell 98 specification (section
21.2.3, http://www.haskell.org/onlinereport/io.html):
Implementations should enforce
On 28 June 2011 18:56, Gracjan Polak gracjanpo...@gmail.com wrote:
Anyway, where do I find an 'openFileShared' function? Packages unix/Win32 do
not
have obvious leads...
Perhaps the functions in System.Posix.IO do what you want?
If you want plain text serialization, writeFile output.txt . show
and fmap read (readFile output.txt) should suffice...
Max
On 9 June 2011 08:23, Dmitri O.Kondratiev doko...@gmail.com wrote:
Hello,
Please advise on existing serialization libraries.
I need a simple way to serialize Data.List
Hi Dmitri,
On 9 June 2011 09:13, Dmitri O.Kondratiev doko...@gmail.com wrote:
I wonder how Haskell will distribute memory between the buffer for
sequential element access (list elements, map tree nodes) and memory for
computation while reading in list, Data.Map from file?
Your list only has
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 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
On 23 May 2011 17:20, michael rice nowg...@yahoo.com wrote:
What's the best way to end up with a list composed of only the Just values,
no Nothings?
http://haskell.org/hoogle/?hoogle=%3A%3A+%5BMaybe+a%5D+-%3E+%5Ba%5D
Data.Maybe.catMaybes is what you want :-)
Cheers,
Max
On 15 May 2011 18:46, Rogan Creswick cresw...@gmail.com wrote:
On Sun, May 15, 2011 at 8:21 AM, Malcolm Wallace malcolm.wall...@me.com
wrote:
On 5/14/11 6:12 PM, Nathan Howell wrote:
Waf supports parallel builds and works with GHC without too much trouble.
I'm surprised no-one has yet
On 13 April 2011 07:59, Svante Signell svante.sign...@telia.com wrote:
As I don't know anything about Haskell, can I make a stupid question: Is
there any method to create debug symbols for a Haskell program, and is
it possible to debug with gdb?
You cannot create debug symbols. Things that are
On 4 April 2011 11:34, Daniel Fischer daniel.is.fisc...@googlemail.com wrote:
If there's only a single encoding recognised, UTF-8 surely should be the
one (though perhaps Windows users might disagree, iirc, Windows uses UCS2
as standard encoding).
Windows APIs use UTF-16, but the encoding of
On 31 March 2011 09:13, Ketil Malde ke...@malde.org wrote:
-- | Try to decode a FilePath to Text, using the current locale encoding. If
-- the filepath is invalid in the current locale, it is decoded as ASCII and
-- any non-ASCII bytes are replaced with a placeholder.
Why not map them to
On 31 March 2011 12:44, oliver mueller oliver.muel...@gmail.com wrote:
it's a bit sad to see that shake is completely off the table since it
really looked good.
I think Neil has had trouble getting permission to release the code,
which is why I wrote openshake.
maybe openshake can fill in
On 30 March 2011 07:52, Michael Snoyman mich...@snoyman.com wrote:
I could
manually do something like (utf8Decode . S8.pack), but that presumes
that the character encoding on the system in question is UTF8. So two
questions:
Funnily enough I have been thinking about this quite hard recently,
On 30 March 2011 10:20, Tako Schotanus t...@codejive.org wrote:
http://www.haskell.org/pipermail/libraries/2009-August/012493.html
I took from this discussion that FilePath really should be a pair of the
actual filename ByteString, and the printable String (decoded from the
ByteString, with
On 13 March 2011 22:02, Jason Dusek jason.du...@gmail.com wrote:
Is there any case in which the empty string would be unsafe?
AFAIK this stuff is only used to setup the +RTS options and some of
the stuff in System.Environment. I think that the contents of the
program name will only cause
On 10 March 2011 17:55, Bas van Dijk v.dijk@gmail.com wrote:
On 10 March 2011 18:24, Yves Parès limestr...@gmail.com wrote:
Why has the operator (.) troubles with a type like (forall s. ST s a)?
Why can't it match the type 'b' in (.) definition?
As explained by the email from SPJ that I
On 10 March 2011 04:04, Jason Dusek jason.du...@gmail.com wrote:
I'm trying to hew relatively close to Duncan Coutts'
blog posting in working through this; so I have different
code and a new Makefile:
Starting with your code I've managed to make it work (OS X 10.6, GHC
7). The Makefile is:
Hi Jason,
Following your advice, I was able to get a working main,
linking the .o's (no attempt at an SO this time) with GHC.
I haven't tried it, but how about this:
1. Use ghc to link a standard Haskell executable that requires your
libraries. Run the link step with -v so you can see the
Hi Jason,
On 8 March 2011 05:28, Jason Dusek jason.du...@gmail.com wrote:
gcc -g -Wall -O2 -fPIC -Wall -o import \
-I/usr/lib/ghc-6.12.1/include/ \
import.c exports.so
In my experience, the easiest way to do this is to use gcc to build
object files from C source files, and then
Hi Remi,
On 6 March 2011 13:38, Remi Turk rt...@science.uva.nl wrote:
I am happy to finally announce cinvoke 0.1, a binding to the
C library cinvoke[1], allowing functions to be loaded and called
whose names and types are not known before run-time.
As the author of the libffi package
Hi Roman,
2011/3/5 Román González romanand...@gmail.com:
ld: warning: in /Users/roman/.homebrew/lib/libncursesw.dylib, file was built
for unsupported file format which is not the architecture being linked
(i386)
This is the problem. You are using OS X 10.6 and Homebrew is building
a 64 bit
On 4 March 2011 06:32, Jason Dusek jason.du...@gmail.com wrote:
-- From
https://github.com/solidsnack/bash/blob/c718de36d349efc9ac073a2c7082742c45606769/hs/Language/Bash/Syntax.hs
data Annotated t = Annotated t (Statement t)
data Statement t = SimpleCommand Expression [Expression]
On 2 March 2011 09:11, Yves Parès limestr...@gmail.com wrote:
class (forall x. Monad (IM i x)) = Impl i where
data IM i :: * - * - *
But GHC forbids me to do so.
The way I usually work around this is by doing something like the
following pattern:
{{{
class Monad1 m where
return1 :: a
2011/3/2 Yves Parès limestr...@gmail.com:
Is what I'm trying to do a common technique to type-ensure contexts or are
there simpler methods?
I don't understand your problem well enough to be able to venture a
solid opinion on this. Sorry! What you have detailed so far doesn't
sound too complex,
On 23 February 2011 05:31, Johan Tibell johan.tib...@gmail.com wrote:
On Tue, Feb 22, 2011 at 9:19 PM, Johan Tibell johan.tib...@gmail.com wrote:
Initial numbers suggest that lookup gets 3% slower and insert/delete
6% slower. The upside is O(1) size.
Can someone come up with a real world
On 23 February 2011 12:05, Gregory Collins g...@gregorycollins.net wrote:
I've been working on one lately, some preliminary benchmarks:
https://gist.github.com/826935
It's probably a month or two away from a releasable state, but my
work-in-progress is substantially faster (4-6X) than
On 23 February 2011 16:03, Johan Tibell johan.tib...@gmail.com wrote:
Thanks for the examples. Point 3 is interesting but most of the gain
there could probably be had by telling the user to use (bigmap `union`
smallmap). My guess is that the user has a good idea which argument is
On 23 February 2011 21:27, Gwern Branwen gwe...@gmail.com wrote:
On Wed, Feb 23, 2011 at 1:18 PM, Johan Tibell johan.tib...@gmail.com wrote:
Could you manually look at some of them to see if you find something
interesting. In particular `Set.size s == 0` (a common use of size in
imperative
On 20 February 2011 03:40, Louis Wasserman wasserman.lo...@gmail.com wrote:
I'd like to complain about that, too ;)
I'm curious, when do people find that they need a really fast way to
get map size? I use them quite a lot, and almost never call length -
and when I do, it is typically only to get
On 20 February 2011 19:56, Mihai Maruseac mihai.marus...@gmail.com wrote:
Hi,
When running Alex -g I get several warning telling me that a bang
pattern is required and that the warning will be an error in GHC 6.14.
As it happens, that is not an error in GHC 7 (see
On 16 February 2011 21:51, Andrew Coppin andrewcop...@btinternet.com wrote:
(Now, if only there was a version that feeds an integer to the monadic
action as well... Still, it's not hard to implement.)
As simple as:
forM [1..x] mk_my_action
___
On 16 February 2011 22:48, Daniel Fischer
daniel.is.fisc...@googlemail.com wrote:
The problem with that is that under certain circumstances the list is
shared in nested loops, which was what caused the thread (it was mapM_ and
not forM_, but I'd be very surprised if they behaved differently
On 17 February 2011 07:28, Sebastian Fischer fisc...@nii.ac.jp wrote:
I must admit I still don't understand your exact problem. Could you help me
with an example where using mtl2 requires an additional (Functor m)
constraint that is not required when using mtl1?
I think the problem is that the
2011/2/15 Gábor Lehel illiss...@gmail.com:
This is a semi-related question I've been meaning to ask at some
point: I suppose this also means it's not possible to write a class,
write some rules for the class, and then have the rules be applied to
every instance? (I.e. you'd have to write them
2011/2/15 Simon Peyton-Jones simo...@microsoft.com:
but currently any pragmas in a class decl are treated as attaching to the
*default method*, not to the method selector:
I see. I didn't realise that that was what was happening. Personally I
find this a bit surprising, but I can see the
On 15 February 2011 11:23, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
I wouldn't necessarily expect this to guarantee inlining for the same
reason that the following code doesn't guarantee that foo gets rewritten
to big:
foo = bar
{-# INLINE bar #-}
bar = big
It might work with the
On 15 February 2011 15:12, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
Ah, but you assume that bar won't be inlined into foo first. Consider that
it is perfectly acceptable for GHC to generate this:
foo = big
{-# INLINE bar #-}
bar = big
We did ask to inline bar, after all.
Well, yes,
On 15 February 2011 16:45, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
Only if foo has an INLINE pragma. Otherwise, GHC uses whatever RHS is
available when it wants to inline.
Ah, I see! Well yes, in that case my workaround is indeed broken in
the way you describe, and there is no way to
On 14 February 2011 10:19, Pierre-Etienne Meunier
pierreetienne.meun...@gmail.com wrote:
For instance, it allows you to program a single function that works for any
dimensionality of the array.
I don't know how vector handles it, but you may be interested to look
at the repa library
On 14 February 2011 21:43, Patrick Bahr pa...@arcor.de wrote:
Am I doing something wrong or is it not possible for GHC to dispatch a rule
according to type class constraints?
As you have discovered this is not possible. You can write the rule
for as many *particular* types as you like, but you
On 14 February 2011 21:00, Andrew Coppin andrewcop...@btinternet.com wrote:
Is this a known bug? (GHC 6.10.x)
It's known to happen when optimising shares what shouldn't be shared. Try
compiling with -O2 -fno-cse (if that doesn't help, it doesn't necessarily
mean it's not unwanted sharing,
On 5 February 2011 02:35, Sebastian Fischer fisc...@nii.ac.jp wrote:
I have not used monad-peel before so please ignore my comment if I am
missing something obvious. The documentation mentions that Instances of
MonadPeelIO should be constructed via MonadTransPeel, using peelIO =
liftPeel
On 5 February 2011 04:19, Anders Kaseorg ande...@mit.edu wrote:
Just to demonstrate that I didn’t use the triviality of ReaderT (), here’s
a less trivial example with ReaderT and StateT:
This is superb, thank you! I would never have come up with that :-)
It still seems to fail somehow on my
On 4 February 2011 02:35, Steve Severance st...@medwizard.net wrote:
Wholly support moving OSX to x64. x86 should be supported only on a
best effort basis for legacy.
Moving from x86 to x64 has advantages and disadvantages from my POV. Advantages:
* Able to address more memory
* More
On 4 February 2011 05:03, Michael Snoyman mich...@snoyman.com wrote:
My guess (a complete guess) is that the deliterate step is creating a
temporary .hs file elsewhere on your filesystem, which is why the CPP
step can't find B.hs without a fully-qualified path.
That is what is happening (you
Hi Anders,
I'm using your monad-peel package to good effect in my project, but
I'm having trouble lifting peelIO through a particular monad. What
follows is a simplified description of my problem. Say I have this
monad:
{{{
data M a = M { unM :: forall m. MonadPeelIO m = Reader.ReaderT () m a }
On 4 February 2011 21:41, Anders Kaseorg ande...@mit.edu wrote:
On Fri, 4 Feb 2011, Max Bolingbroke wrote:
data M a = M { unM :: forall m. MonadPeelIO m = Reader.ReaderT () m a }
Maybe this won’t help in your actual code, but isn’t M isomorphic to IO
(via unM :: M a - IO a, M . liftIO :: IO
On 2 February 2011 11:57, Simon Hengel simon.hen...@wiktory.org wrote:
Hello,
I wrote a tiny Snap app that provides reverse dependency lookup for all
packages on Hackage.
Are you familiar with Roel van Djik's revdep Hackage?
http://bifunctor.homelinux.net/~roel/hackage/packages/hackage.html
On 31 January 2011 14:17, Leon Smith leon.p.sm...@gmail.com wrote:
Is there some subtle semantic difference? Is there a performance
difference? It seems like a trivial thing, but I am genuinely
curious.
According to my understanding the two should have equivalent
semantics. As for
On 19 January 2011 23:59, Evan Laforge qdun...@gmail.com wrote:
Another thing is that performance in logging is pretty critical. When
I profile, logging functions wind up in the expensive list if I'm not
careful. I don't know bad an unsafePerformIO plus a catch for every
log msg is going to
On 20 January 2011 17:30, Gwern Branwen gwe...@gmail.com wrote:
* You need to loosen the base upper bound to 4.4
* If using base = 4, you need to depend on the syb package as well
(current version 0.3)
Would this break GHC 6.12 builds?
Thats why I suggested the flag stanza. Cabal has a
On 20 January 2011 20:50, Gwern Branwen gwe...@gmail.com wrote:
Notice the flag defaults to False, not True. When I tried it with True, I got:
$ cabal install
Resolving dependencies...
cabal: dependencies conflict: base-3.0.3.2 requires syb ==0.1.0.2 however
syb-0.1.0.2 was excluded because
On 20 January 2011 22:39, Gwern Branwen gwe...@gmail.com wrote:
It's just a folder in the lambdabot repo, as is lambdabot-utils and
unlambda and brainfuck.
I'm happy to report that show-0.4.1.1 does in fact build in my GHC 7
environment unmodified, so the Cabal hackery is working. You might
On 19 January 2011 22:43, Evan Laforge qdun...@gmail.com wrote:
Reasons why I
don't actually want this after all?
Are you aware of the magic assert function?
http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#v:assert
The compiler spots it and
On 18 January 2011 19:32, Joe Bruce bruce.jo...@gmail.com wrote:
I did them both from scratch, just to make sure I
understood what was going on and could communicate it for the next poor sap
that is as ignorant as I was.
Congratulations :-)
Should/can I update the haskellwiki with this
Hi,
I also wanted to build gitit on Windows and encountered the datetime
issue. I sent the maintainer (Eric Sessoms) a request to bump his
version bounds on the 22nd December, but haven't received a reply. (I
had to bump a lot of other gitit version bounds, but those bumps
*have* been taken
On 7 January 2011 06:20, Joe Bruce bruce.jo...@gmail.com wrote:
Thanks Max. That makes a lot of sense. That change got me to the point of
linking lambdabot.
Well, I tried to see if I could reproduce your problem but didn't get
to this stage. It looks like v4.2.2.1 from Hackage hasn't been
On 6 January 2011 07:27, Joe Bruce bruce.jo...@gmail.com wrote:
Now I'm stuck on readline again [lambdabot build step 28 of 81]:
/Users/joe/.cabal/lib/readline-1.0.1.0/ghc-6.12.3/HSreadline-1.0.1.0.o:
unknown symbol `_rl_basic_quote_characters'
This seems to have been covered on Stack
On 6 January 2011 16:11, Joe Bruce bruce.jo...@gmail.com wrote:
Thanks, Max. I had seen that thread already, but I don't understand how it
helps me. I'm on a x64 mac and I have both an i386 and x64 version of
readline installed (via macports install readline +universal). Perhaps
cabal is
Hi Stephen,
On 2 January 2011 13:35, Stephen Tetley stephen.tet...@gmail.com wrote:
Can a lazy cons be implemented for (infinite) Streams in the
Stream-Fusion style?
I made a mailing list post about almost exactly this issue a while ago
On 23 December 2010 05:29, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
If so, OK, then I think I could make a packInt which turns an Int
into 4 Word8 first. Thus under all situation (ascii, UTF-8, or even
UTF-32), my program always send 4 bytes through the network. Is that
OK?
On 17 December 2010 12:45, Larry Evans cppljev...@suddenlink.net wrote:
Am I doing something wrong or has somehow community.haskell.org been
hijacked somehow?
Er, it works for me. Maybe *your* DNS has been hijacked? I know lots
of Windows viruses play tricks like this...
Max
On 17 December 2010 00:59, Gregg Reynolds d...@mobileink.com wrote:
My real goal is to think about better
language for software build systems, since what we have now is pretty weak,
in my view.
I can't speak for your monad based approach, but you may be interested
in Neil Mitchell's Haskell
3, John Smith volderm...@hotmail.com wrote:
I would like to formally propose that Monad become a subclass of
Applicative
I'm not in favour of this change because of the code breakage issue.
However, I think that an acceptable plan (mentioned elsewhere on the
list, but doesn't seem to have had
On 12 December 2010 12:26, Stephen Tetley stephen.tet...@gmail.com wrote:
type instance (DUnit a ~ DUnit b) = DUnit (a,b) = DUnit a
Requires UndecidableInstances but should work:
{-# LANGUAGE TypeFamilies #-}
type family DUnit a :: *
data Point u = P2 u u
type instance DUnit (Point
On 10 November 2010 12:49, Patrick LeBoutillier
patrick.leboutill...@gmail.com wrote:
I'm a total newbie with respect to the lambda calculus. I tried
(naively) to port
these examples to Haskell to play a bit with them:
[snip]
You can give type signatures to your first definitions like this:
On 9 November 2010 08:01, Mark Spezzano mark.spezz...@chariot.net.au wrote:
I want to be able to run it from the command line in a terminal window, and
have the text come up in colours (but very fast). My current version is
already very fast, but I've heard everyone raving about how slow
On 2 November 2010 14:10, Bertram Felgenhauer
bertram.felgenha...@googlemail.com wrote:
Indeed. I had a lot of fun with the ideas of this thread, extending
the 'Force' type family (which I call 'Eval' below) to a small EDSL
on the type level:
I also came up with this.. I was trying to use it
2010/11/2 Günther Schmidt gue.schm...@web.de:
I've been given a few hints over time when I asked question concerning DSLs
but regretfully didn't follow them up.
I think this is probably to do with observable sharing. The problem in
DSLs is if you have:
fact :: Term - Term
fact = Factorial
On 23 October 2010 15:32, Sjoerd Visscher sjo...@w3future.com wrote:
A little prettier (the cata detour wasn't needed after all):
data IdThunk a
type instance Force (IdThunk a) = a
Yes, this IdThunk is key - in my own implementation I called this Forced, so:
type instance Force (Forced
On 19 October 2010 19:01, Dan Doel dan.d...@gmail.com wrote:
However, this argument is a bit circular, since that eliminator could be
defined to behave similarly to an irrefutable match.
Right.
Or, put another
way, eta expansion of a dictionary-holding existential would result in a value
Hi Cafe,
In generic programming, e.g. as in Data Types a la Carte and Compos,
you often wish to work with data types in their fix-point of a functor
form. For example:
data ListF a rec = Nil | Cons a rec
newtype List a = Roll { unroll :: ListF a (List a) }
In some presentations, this is done
On 22 October 2010 12:03, Dan Doel dan.d...@gmail.com wrote:
data Mu f = In { out :: f (Mu f) }
instance Show (f (Mu f)) = Show (Mu f) where
show = show . out
Is that an example of a value recursive dictionary?
Assuming the Show (f (Mu f)) instance uses the (Mu f) one, AFAIK this
Forgot to reply to list
On 22 October 2010 12:14, Dan Doel dan.d...@gmail.com wrote:
Another solution, though, is SHE. With it, you can write:
data ListF a r = NilF | ConsF a r
newtype List a = Roll (ListF a (List a))
pattern Nil = Roll NilF
pattern Cons x xs = Roll (ConsF x xs)
On 22 October 2010 22:06, Dan Doel dan.d...@gmail.com wrote:
SHE's pattern synonyms also work as expressions, so there's no asymmetry. They
work just like constructors as far as I can tell (with what little I've played
with them); you can even partially apply them (in expressions).
I didn't
Hi Oleg,
Thanks for your reply!
Really? Here are two 'cons' that seem to satisfy all the criteria
Thanks - your definitions are similar to Roman's suggestion.
Unfortunately my criteria 3) is not quite what I actually wanted - I
really wanted something GHC-optimisable - (so non-recursive
Hi Gregory,
On 15 October 2010 22:27, Gregory Crosswhite gcr...@phys.washington.edu wrote:
Out of curiosity, are there any plans for GHC to eventually use the Strict
Core language described in
http://www.cl.cam.ac.uk/~mb566/papers/tacc-hs09.pdf?
I do not have plans to add it. I think it would
Hi Cafe,
I've run across a problem with my use of existential data types,
whereby programs using them are forced to become too strict, and I'm
looking for possible solutions to the problem.
I'm going to explain what I mean by using a literate Haskell program.
First, the preliminaries:
{-#
On 16 October 2010 12:16, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
eta :: Stream a - Stream a
eta s = Stream s next
where
next (Stream s next') = case next' s of
Just (x,s') - Just (x,Stream s' next')
Nothing -
On 14 October 2010 08:34, Jacek Generowicz jacek.generow...@cern.ch wrote:
Those other data might be the functions' arguments, or they might be other
functions with which they are to be combined, or both.
You can represent these as existential packages. However, as Oleg
shows you can always use
On 14 October 2010 08:56, Max Bolingbroke batterseapo...@hotmail.com wrote:
But if the only operation you ever do on this pair is (.), you may as
well skolemise and just store (fnA1 . fnA2) directly. What is the
advantage of doing otherwise?
I forgot to mention that if you *really really* want
On 13 October 2010 08:57, Jason Dusek jason.du...@gmail.com wrote:
Is there a way to write a Haskell data structure that is
necessarily only one or two or seventeen items long; but
that is nonetheless statically guaranteed to be of finite
length?
Maybe you want a list whose denotation is
On 8 October 2010 10:54, Simon Marlow marlo...@gmail.com wrote:
We could make GHC respect the report, but we'd have to use
(e op) == let z = e in \x - z op x
to retain sharing without relying on full laziness.
This might be a good idea in fact - all other things being equal, having
1 - 100 of 207 matches
Mail list logo