carte, I just found it overly
complicated.
Thanks for you solution, Job. However (and even if it doesn't work without
it) I fail to see why you need the functional dependency on Has...
Doesn't it implies here that for one 'a' there can only be one 'b' such as
'Has b a'?
2011/4/6 Job Vranish
I think you want something like this:
{-# Language MultiParamTypeClasses
, FlexibleInstances
, FunctionalDependencies
, UndecidableInstances
, FlexibleContexts
, OverlappingInstances
#-}
data Character a = Character { life :: Int,
Is there a particular reason that the
transformershttp://hackage.haskell.org/packages/archive/transformers/latest/doc/html/Control-Monad-Trans-Maybe.html#v:MaybeTversion
of the MaybeT monad does not have a MonadFix instance?
It seems like the following instance would be suitable:
instance
The tutorial here:
http://legacy.cs.uu.nl/daan/download/parsec/parsec.html#Lexical analysis
http://legacy.cs.uu.nl/daan/download/parsec/parsec.html#Lexical analysisis
for parsec 2, but it's still quite relevant.
- Job
On Tue, Mar 8, 2011 at 6:22 AM, Hauschild, Klaus (EXT)
Make your own expression type and make it an instance of the Num typeclass.
Then you can build your expression using the usual operators and then use
show to convert to a string.
For example:
https://github.com/jvranish/grhug/blob/master/SymbolicDifferentiation/SymbolicDifferentiation.hs
It
Thanks,
Perhaps my algorithm works then. I shall have to read up more on these
things :)
- Job
On Mon, Feb 21, 2011 at 4:54 PM, Luke Palmer lrpal...@gmail.com wrote:
On Sun, Feb 20, 2011 at 6:01 PM, Job Vranish jvran...@gmail.com wrote:
My current algorithm says that neither of the types you
You need the MaybeT and EitherT monad transformers:
http://hackage.haskell.org/packages/archive/MaybeT/0.1.2/doc/html/Control-Monad-Maybe.html
http://hackage.haskell.org/packages/archive/MaybeT/0.1.2/doc/html/Control-Monad-Maybe.html
On Sun, Feb 20, 2011 at 8:56 PM, Brandon Moore brandon_m_mo...@yahoo.comwrote:
Typechecking with regular types isn't hard.
So do I have the right idea then? To check against a signature, I can just
unify the two types and then check if the unified type is 'equivalent' (is
there a special word
I'm curious, is it possible that your new timeout implementation would fix
this problem?:
doesntWork :: Int - Int
doesntWork x = last $ cycle [x]
test :: IO (Maybe Bool)
test = timeout 1 $ evaluate $ doesntWork 5 == 5 -- never terminates, even
with the timeout
From what I can gather, this
is on github here: https://github.com/jvranish/InfiniteTypes
Also, is there a book you'd recommend that would explain this in further
detail?
Thanks,
- Job
On Mon, Feb 16, 2009 at 5:16 PM, Luke Palmer lrpal...@gmail.com wrote:
On Sat, Feb 14, 2009 at 2:06 PM, Job Vranish jvran...@gmail.com wrote
I'm trying to test some properties with quickcheck. If these tests fail,
they will almost certainly fail by nontermination.
I've been using the 'within' function to catch these nontermination cases.
However, I was surprised to find that this doesn't always work.
'within' uses the 'timeout'
. This behavior is quite
annoying.
Thanks for your help,
- Job
On Tue, Feb 1, 2011 at 11:18 AM, Daniel Fischer
daniel.is.fisc...@googlemail.com wrote:
On Tuesday 01 February 2011 16:40:43, Job Vranish wrote:
I'm trying to test some properties with quickcheck. If these tests fail
The answer is yes, but could you elaborate? What exactly are you wanting? Do
you want something similar to ghci? Are you wanting to implement a REPL for
some other language in haskell? REPL for haskell, in haskell?
- Job
On Mon, Dec 20, 2010 at 12:47 PM, Aaron Gray
Yes, and yes :)
For example:
import Data.Char
main = do
let prompt s = do
putStrLn s
getLine
firstName - prompt What's your first name?
lastName - prompt What's your last name?
let bigFirstName = map toUpper firstName
bigLastName = map toUpper lastName
putStrLn $ hey
For monads like StateT, WriterT, ReaderT, the order doesn't matter (except
perhaps for some pesky performance details). However, for monad transformers
like ErrorT or ListT, the order _does_ matter.
The code you have there is perfectly fine, sometimes the added generality
can be quite handy
Yeah Atom is pretty slick, though unfortunately it's not quite powerful
enough for much of the stuff that we do.
John Van Enk and I are actually working on a language that's similar to C
(and compiles to C), but has polymorphism, type inference and other goodies.
The goal is to make working on
Both Git and GitHub are fantastic. (and very convenient for contributors)
Also if you're the kind of person who's into GUI's, SmartGit is quite good
as well.
- Job
On Wed, Aug 4, 2010 at 3:28 PM, Frank Kupke f...@informatik.uni-kiel.dewrote:
John,
a very nice idea. I have not worked with
+ 1
This is probably the biggest obstacle to using Haskell where I work.
(Aviation industry, software for flight management systems for airplanes)
We often need to perform some computations with hard deadlines, say every
20ms, with very little jitter.
Major GC's spoil the fun; It's quite easy
You might try emailing the maintainer directly. The package appears to be
actively maintained.
- Job
On Fri, Jul 30, 2010 at 3:17 AM, Eitan Goldshtrom thesource...@gmail.comwrote:
I'm trying to install SDL through Cabal -- I don't know another way to
install it. However, I'm getting this:
I think you can just install the windows gtk dev libraries from here:
http://www.gtk.org/download.html
- Job
On Thu, Jul 29, 2010 at 5:20 PM, Alessandro Stamatto astama...@gmail.comwrote:
Installing Yi Editor i get the following error:
--
Yeah I recently ran into this myself. (
http://osdir.com/ml/haskell-cafe@haskell.org/2010-07/msg00020.html). It's
not a bug, just a limitation of haskell's inference algorithm for mutually
recursive groups of functions.
The problem is that haskell infers groups (the strongly connected
components)
You might try pulling downloading the package ('cabal fetch org' will do
this) and changing the base dependency (to = 4.1) in the orc.cabal file and
then build it manually (cabal configure cabal build cabal install
(while in the same directory as the .cabal file)) and see what happens.
I don't
Yeah, using openGL Points to draw 2D images will probably be pretty slow.
However, if you don't need to change your points every frame, a display list
might improve the speed quite a bit (you could still transform the points as
a whole).
Also, you could try the SDL bindings for haskell:
Atomic operations are special operations where you don't have to worry about
some other process messing with things while the operation is taking place.
For a simple example of why atomic operations are important:
(taken from: http://en.wikipedia.org/wiki/Linearizability#Non-atomic)
The naive,
I think most of the Erlang style actors with message passing can be done in
Haskell with just TChan and forkIO.
http://en.wikibooks.org/wiki/Haskell/Concurrency
- Job
On Sun, Jul 25, 2010 at 4:55 PM, Yves Parès limestr...@gmail.com wrote:
Hello !
I've been studying Erlang and Scala, and I
I agree. A web forum would be more friendly to newcomers, easier to browse,
and better organized, than the mailing list.
Some people will still prefer the mailing list of course, but I think there
will be enough demand to justify a forum :)
- Job
On Mon, Jul 26, 2010 at 9:57 AM, Daniel Díaz
Yeah, ErrorT should do what you want (EitherT is probably essentially the
same thing)
login would have the type:
login :: String - String - ErrorT DServError IO LoginResponse
and you would use it like this:
result - runErrorT $ authenticatedReq
You can use runErrorT, or catch when you want to
Martijn van Steenbergen has a good blog post that describes the method I
generally use:
http://martijn.van.steenbergen.nl/journal/2010/06/24/generically-adding-position-information-to-a-datatype/
In his example he annotates the expression tree with position information,
but you can use the same
I haven't used the Gtk bindings much, but the qtHaskell bindings work quite
well. If you've used Qt before, it should be pretty easy to pick up.
- Job
On Mon, Jul 19, 2010 at 10:19 AM, Ali Razavi ali.raz...@gmail.com wrote:
Greetings,
I have only used the wxHaskell library before, but I am
questions about it.
- Job
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=27823#a27823
2010/7/19 Job Vranish job.vran...@gmail.com
I didn't get any attachments from you, but haskell-cafe might filter them
out (I'm not sure).
But, the usual derived instances for Show should work fine for your
For working with record fields inside of state monads I would recommend
trying out one of these packages:
lenses
fclabels
data-accessor
(I think I'm forgetting a couple)
They all have special mechanisms for working with record fields inside state
monads (and have lots of other cool stuff)
I'm
If your integers have a bounded size, then your Turing machine is not Turing
complete and can't run a Haskell interpreter.
You might be tempted to just make the numbers really big, but bounded, and
then say that you can still run most interesting programs while skirting the
issue of non
Esteemed fellow haskellers,
I recently ran into a very simple real life case where Haskell's rules for
inferring the types for mutually recursive definitions resulted in a type
that was less general than it could be. It took me a while to realize that
the type error I was getting wasn't actually
I've been using the geany http://www.geany.org/ editor recently and I was
shocked to find that it has decent source browsing capabilities (that work
with haskell even!). You can find where something is defined and find other
usages of things. It's a bit crude, but gets the job done well enough.
-
Yeah I don't see why not. The ContT monad should work great.
Also, depending on what you're doing, the ErrorT monad might do what you
want as well.
- Job
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
Yeah, I might actually prefer calling it EitherT instead of ErrorT. It
doesn't have to be used for error, it's just what it is most often used for.
- Job
On Thu, Jun 10, 2010 at 3:57 PM, Maciej Piechotka uzytkown...@gmail.comwrote:
On Thu, 2010-06-10 at 14:09 -0500, Tim Wawrzynczak wrote:
Sorry for reopening an old thread, but I thought I'd counter some of the
negative feedback :)
I think this proposal is a great idea!
It seems like this would make working with MPTCs much easier.
When programming, I generally want to only specify the minimum amount of
information to make my code
Anybody know of a good grad school in the US for functional languages?
(good = has Ph.D. program that covers functional languages, type systems,
correctness proofs, etc...)
So far Indiana University is the only one I've found that has a strong
showing in this area.
A way to get into one of the
://mpri.master.univ-paris7.fr/
Which gathers the best french students (from such schools as Ecole
Polytechnique, ENS Ulm, ENS Cachan). Or I know else of people who did a
Ph.D. in sweden with Thierry Coquand for instance. Per Martin-Löf is there
too.
Cheers,
PE
El 13/05/2010, a las 13:41, Job
I vote for adding a feature that would let people post comments/code
snippets to the documentation of other peoples packages :)
It would be even nicer if you could post comments to individual haskell
definitions on the haddock page, and then hide most of them by default under
an expander of some
On Fri, Apr 9, 2010 at 9:46 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Job Vranish job.vran...@gmail.com writes:
I vote for adding a feature that would let people post comments/code
snippets to the documentation of other peoples packages :)
You mean turn every hackage
On Fri, Apr 9, 2010 at 10:31 AM, Edward Kmett ekm...@gmail.com wrote:
On Fri, Apr 9, 2010 at 10:21 AM, Job Vranish job.vran...@gmail.comwrote:
On Fri, Apr 9, 2010 at 9:46 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Job Vranish job.vran...@gmail.com writes:
I vote
On Fri, Apr 9, 2010 at 10:46 AM, Malcolm Wallace
malcolm.wall...@cs.york.ac.uk wrote:
It would be even nicer if you could post comments to individual haskell
definitions on the haddock page, and then hide most of them by default
under
an expander of some sort.
Rather than, you know,
Is haskell supposed to always infer the most general type (barring
extensions)?
I found a simple case where this is not true:
f _ = undefined
where
_ = y :: Int - Int
y x = undefined
where
_ = f x
Haskell infers the types of 'y' and 'f' as:
f :: Int - a
y :: Int - Int
This
So in Haskell 98, would the added constraints result in a type error?
- Job
On Tue, Apr 6, 2010 at 5:12 PM, Ross Paterson r...@soi.city.ac.uk wrote:
On Tue, Apr 06, 2010 at 03:56:32PM -0400, Job Vranish wrote:
f _ = undefined
where
_ = y :: Int - Int
y x = undefined
where
Thank you all for your replies. This is all much more clear now :)
- Job
On Tue, Apr 6, 2010 at 7:00 PM, Ross Paterson r...@soi.city.ac.uk wrote:
On Tue, Apr 06, 2010 at 05:18:34PM -0400, Job Vranish wrote:
So in Haskell 98, would the added constraints result in a type error?
Yes, because
sophisticated way to keep track of the list lengths
that doesn't have this problem, but I really like the simplicity of the
current implementation.
- Job
On Sun, Mar 21, 2010 at 2:37 AM, Casey McCann syntaxgli...@gmail.comwrote:
Job Vranish job.vran...@gmail.com wrote:
Its main advantages
I uploaded a new fixed length list library to hackage:
http://hackage.haskell.org/package/fixed-list
Its main advantages are:
Very easy to use.
Almost entirely Haskell98 (the non Haskell98 pieces are not critical, just
nice)
The datatype is a member of Foldable, Traverable, Applicative,
A phantom type might do what you want:
-- notice the type parameter on point that isn't used in the type
data Point a = Cartesian (Cartesian_coord, Cartesian_coord)
| Spherical (Latitude, Longitude)
-- make some dummy types
data SphericalP
data CartesianP
--make some
Hoogle is a great tool for finding haskell functions:
http://www.haskell.org/hoogle/
You can punch in the type of a function you want and it will give you a list
of functions that might do what you need.
Generalizing the types a bit usually helps. Searching for either m a - n m
a or IO a -
This seems really confusing.
It would imply that if I write a library that is designed to talk to some
part of the linux kernel API (which is GPL'd) then I'd have to release my
library under the GPL. And anything that used my libraries API would need to
be GPL'd too, etc...
Which would mean that
I'm pretty sure you don't need mingw and all that. I've bootstrapped
cabal-install on windows a few times now without needing anything more than
ghc (though I haven't done 6.12 yet so I might be totally off base here...)
You can't use the nice bootstrap script, but you can download and build the
Sweet :)
I'm glad that notFollowedBy has been fixed. I've often had to redefine it
because the type was to restrictive.
- Job
On Wed, Mar 3, 2010 at 11:45 PM, Derek Elkins derek.a.elk...@gmail.comwrote:
Parsec is a monadic combinator library that is well-documented, simple
to use, and
My current area of work is on realtime embedded software programming for
avionics systems. We do most of our coding in Ada but I've been dreaming of
using haskell instaed.
However, the garbage collector is actually one of the larger obsticles to
making this happen.
All of our avionics software
On Mon, Mar 1, 2010 at 2:37 PM, Thomas Schilling nomin...@googlemail.comwrote:
On 1 March 2010 16:27, Job Vranish job.vran...@gmail.com wrote:
My current area of work is on realtime embedded software programming for
avionics systems. We do most of our coding in Ada but I've been dreaming
On Sat, Feb 27, 2010 at 11:53 AM, Andrew Coppin andrewcop...@btinternet.com
wrote:
If you use something like the State or Reader monad, it becomes trivial to
temporarily modify the carried state. But maybe something like this is
occasionally useful. (In particular, it seems to allow you to
Anyone know of a type inference utility that can run right on haskell-src
types? or one that could be easily adapted?
I want to be able to pass in an HsExp and get back an HsQualType. It doesn't
have to be fancy, plain Haskell98 types would do.
It wouldn't be to hard to make one myself, but I
I have a little haskell matrix library for fixed sized matricies on github:
http://github.com/jvranish/VectorMatix
which I've just realized is horribly out of date...I'll update it tonight
and probably push it to hackage too...
but if you're really want to stick with the [[Double]] type,
you can
Cool, Thanks :D
also quickcheck says the two algorithms are equivalent :)
On Fri, Jan 29, 2010 at 4:33 AM, Nick Smallbone nick.smallb...@gmail.comwrote:
Job Vranish jvran...@gmail.com writes:
Ideally we'd like the type of convert to be something like:
convert :: LambdaExpr - SKIExpr
There is a nice simple algorithm on wikipedia:
http://en.wikipedia.org/wiki/Combinatory_logic
(for both SKI and BCKW)
translated to haskell:
-- The anoying thing about the algorithm is that it is difficult to separate
the SKI and LC expression types
-- it's easiest to just combine them.
data
)))
A while ago I tried modifying the algorithm to be pure top-down so that it
wouldn't have this problem, but I didn't have much luck.
Anybody know of a way to fix this?
- Job
On Thu, Jan 28, 2010 at 10:21 AM, Felipe Lessa felipe.le...@gmail.comwrote:
On Thu, Jan 28, 2010 at 09:23:23AM -0500, Job
I won't mention the name so as not to offend anyone.
Oh I'm sure we can handle it ;)
Though I'm curious as to how a language could be effect free in a practical
sense, but not a strict one? could you give an example?
To answer your original question, there are many benefits haskell gains
Wow, this looks like a bug to me. If it's not a bug, then it's horribly
unintuitive.
I extended your example in an effort to figure out what was going on.
Apparently weak pointers loath live IORefs:
import Data.IORef
import Data.Maybe
import System.Mem
import System.Mem.Weak
import Control.Monad
Could mkWeakPair do what you want?
http://haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-Weak.html#v:mkWeakPair
Or are you trying to do something else?
- Job
2009/11/2 Patai Gergely patai_gerg...@fastmail.fm
Hello all,
I wanted to create a weak pointer with an IORef as the key
If you use a monad instance for ZipLists as follows:
instance Monad ZipList where
return x = ZipList $ repeat x
ZipList [] = _ = ZipList []
xs = f = diagonal $ fmap f xs
(where diagonal pulls out the diagonal elements of a ziplist of ziplists)
It will satisfy all the monad laws _except_
I was recently working on an type inference algorithm and to test it I did
the following:
Used the quickcheck Arbitrary typeclass to generate expressions
Inferred types of the expressions using my algorithm,
converted the expressions that passed inference to haskell and wrote them
to a file
Nope,
Other than possibly adding library clutter.
I have a package that provides many instances and common functions for
ZipLists. Eventually I might stick it on hackage, but currently it's here:
http://github.com/jvranish/ZipList
I really with there was a way to switch Applicative (or other)
Stable pointers might do what you want:
http://haskell.org/ghc/docs/latest/html/libraries/base/Foreign-StablePtr.html
Though an IORef would probably work just as well, depending on how you
needed to use it..
- Job
On Fri, Oct 16, 2009 at 2:59 PM, Alan Carter alangcar...@gmail.com wrote:
Hi,
You are in luck!
Such an instance is very simple with Applicative. If the type you want a Num
instance for is a member of the Applicative type class you can define it
like this:
instance (Num a) = Num (Vector2 a) where
a + b = pure (+) * a * b
a - b = pure (-) * a * b
a * b = pure (*) * a
In what way is it not a number?
data MyNumber a = MyNum a a
deriving (Show, Eq)
instance Functor MyNum where
fmap f (MyNum a b) = MyNum (f a) (f b)
instance Applicative MyNum where
pure a = MyNum a a
MyNum f g * MyNum a b = MyNum (f a) (g b)
instance (Num a) = Num (MyNum a) where
a
Along the projection/co-algebra lines (I actually didn't know that's what
they were called until today :) yay for learning new things!)
How about something like this:
-- Define prototypes for your class of actions here
data Actor = Actor {pos::Vector2 Float, move::Vector2 Float - Actor}
--
.
- Job
On Thu, Oct 1, 2009 at 11:35 AM, Job Vranish jvran...@gmail.com wrote:
Along the projection/co-algebra lines (I actually didn't know that's what
they were called until today :) yay for learning new things!)
How about something like this:
-- Define prototypes for your class of actions
If there is demand for shops to work on smaller jobs in haskell then I
think a having a more specific marketplace/communication platform for
haskell work would be very helpful. If there is a perceived demand, supply
will soon follow.
- Job
On Tue, Sep 29, 2009 at 5:48 AM, Jörg Roman Rudnick
Andrew Coppin andrewcop...@btinternet.com wrote:
how do we fix all this?
I think the key here is to reduce the cost of contribution to a minimum.
Make it as easy as possible to contribute an example, or to fill in some
missing documentation (and to find it later).
Cabal and hackage have made
Short answer: There is no good way of doing what you want.
This is actually one of my biggest annoyances with haskell (right up there
with disallowing infinite types). They are many techniques that work better
or worse depending on the application, but non are very satisfactory IMO.
Your typeclass
table or the graph structure itself will
outgrow available memory.
-Rod
On Thu, 17 Sep 2009 13:32:13 -0400
Job Vranish jvran...@gmail.com wrote:
What are you trying to use this for? It seems to me that for memo
tables you almost never have references to they keys outside
Hey it works :D
Here is a proof of concept:
http://gist.github.com/189104
Maybe later today I'll try to make a version that can be safely used outside
IO.
- Job
On Fri, Sep 18, 2009 at 10:19 AM, Job Vranish jvran...@gmail.com wrote:
Yeah it seems like the general solution to the problem
Yeah linking in windows is _very_ slow. Supposedly this is because the
linker forks a lot of processes. In linux this is fine as forking is dirt
cheap, but in windows (at least older versions, not completely sure about
vista or 7) forking is expensive.
Building a Qt app on my EEE in linux only
(-) happens to be the only prefix operator in haskell, it also an infix
operator.
so:
4 - 2
2
-3
-3
((-) 5) 3 -- note that in this case (-) is treated like any regular
function so 5 is the first parameter
2
(5 - ) 3
2
(-5 )
-5
(flip (-) 5) 3
-2
It's a little wart brought about by the
What are you trying to use this for? It seems to me that for memo tables you
almost never have references to they keys outside the lookup table since the
keys are usually computed right at the last minute, and then discarded
(otherwise it might be easier to just cache stuff outside the function).
The problem is that you are using 'suc' as if it is a constructor: ((suc m)
`eq` (suc n) = m `eq` n)
You'll have to change it to something else, and it will probably require
adding an unpacking function to your class and it will probably be messy.
I'd suggest you make use of the Eq typeclass and
Does anyone know of a hackage package that has fixed length list type that
is an instance of Applicative, Foldable and Traversable?
(a list type that somehow encodes its length in the type)
I've found lots of fixed length list types, but non that are members of the
common typeclasses.
I've
Steenbergen
mart...@van.steenbergen.nl wrote:
Job Vranish wrote:
A simple but powerful implementation of function lenses (aka functional
references, accessors, etc..).
Nice! I will definitely give it a whirl when I pick up my MUD again. I'm
currently using accessors there. I see your
Did you by chance use the prebuilt ghc binaries? or build ghc manually?
- Job
On Mon, Aug 31, 2009 at 5:23 PM, Paulo Tanimoto tanim...@arizona.eduwrote:
Hello,
On Mon, Aug 31, 2009 at 3:29 PM, Job Vranishjvran...@gmail.com wrote:
I got around this problem by downgrading to 6.10.3 (I think
cabal install derive-0.1.4
On Wed, Sep 2, 2009 at 1:12 PM, Grigory Sarnitskiy sargrig...@ya.ru wrote:
How to install specific version of a package (derive 0.1.4)?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
A simple but powerful implementation of function lenses (aka functional
references, accessors, etc..).
This library provides a convenient way to access and update the elements of
a structure. It is very similar to Data.Accessors, but simpler, a bit more
generic and has fewer dependencies. I
Deallocation is automatic (just like C++ Qt)
C++ Qt has excellent unicode support. I haven't explicit tried it in
qtHaskell, but as far as I know it should work just fine.
Unfortunatly it does not currently build just with cabal, however the build
scripts are very clean (no configure) and the
Job Vranish wrote:
I recommend qtHaskell.
I am a big fan of Qt in general. It has good documentation and extensive
examples, is very well designed, and has a good license. I'd even say the
C++ version is good choice for beginners (certainly easier to understand/use
than say GTK).
The qtHaskell
that function, stable names are not that useful I guess? they
would cause a space leak?
On Mon, Aug 31, 2009 at 10:59 PM, Job Vranish jvran...@gmail.com wrote:
I also would like a isStableNameTargetAlive function.
Though if you had such a function then you probably _could_ make a
deRefStableName
ghc 6.8.x...
HTH
Mike.
Job Vranish wrote:
lol, yep you're right. I'd assumed the haskell platform shipped with the
latest parsec, when in fact it does not :) my bad...
However, I fixed the cabal issue by installing ghc 6.10.3 and rebuilding
the haskell platform. Apparently
I also would like a isStableNameTargetAlive function.
Though if you had such a function then you probably _could_ make a
deRefStableName function, which, since there isn't one, probably means that
such a function would be hard to make.
- Job
On Sun, Aug 30, 2009 at 4:54 PM, Peter Verswyvelen
I recommend qtHaskell.
I am a big fan of Qt in general. It has good documentation and extensive
examples, is very well designed, and has a good license. I'd even say the
C++ version is good choice for beginners (certainly easier to understand/use
than say GTK).
The qtHaskell bindings are also
I tried this using timeout, but was never able to get it to work. The
timeout doesn't behave like I expect. I can take several seconds for it to
timeout, even with very low timeouts.
Any ideas?
- Job
module Main where
import Data.IORef
import System.Timeout
import System.IO.Unsafe
tailScan f
You could test your instance using the checkers package on hackage (has
quickcheck properties for common typeclasses) to see if it fulfills the
applicative laws.
But I'm not sure if it is acceptable to define applicative instances that
don't match the monad instance.
Does anyone know of libraries
in the collection, if they don't match either raise an
error or return Nothing.
Not sure if I feel that evil though :D
Thanks again for the input :)
- Job
On Fri, Aug 21, 2009 at 7:26 AM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
Heinrich Apfelmus wrote:
Job Vranish wrote:
I've been
s...@informatik.uni-kiel.de wrote:
On Aug 21, 2009, at 5:11 PM, Job Vranish wrote:
I also added an extra phantom type parameter to the collection (and key)
so that I can prevent keys from being used on different collections even if
they hold elements of the same type.
I have
Yeah, that's weird. I played around with la and it seems to only cause
problems when the parser passed into lookAhead succeeds, which seem to go
directly against it's stated purpose.
lookAhead isn't consuming, (hence the unexpected b) but still prevents
| from doing it's thing.
Seems like a
Your setPixel function is almost ready to work in a State monad
If you modify your setPixel function slightly like so:
setPixel' :: Int - Int - Color - B.ByteString - ((), B.ByteString)
setPixel' x y (r,g,b) image = ((), B.concat [beforePixel, pixel,
afterPixel])
and then wrap it in the State
Opps:
setPixel = State setPixel'
should be:
setPixel x y rgb = State $ setPixel' x y rgb
- Job
On Thu, Aug 20, 2009 at 1:05 PM, Job Vranish jvran...@gmail.com wrote:
Your setPixel function is almost ready to work in a State monad
If you modify your setPixel function slightly like so
try works in this case, but it won't if we are using a parser which can
consume and then fail (instead of char 'a'). In which case we may want it to
fail without exploring the second option.
Hmmm though you might be right. Having lookAhead return Consumed is only a
problem if the parser passed to
1 - 100 of 125 matches
Mail list logo