Re: [Haskell-cafe] Using lenses

2013-10-03 Thread Tony Morris
Lenses for nested sum types e.g. Either. On 03/10/2013 6:08 PM, Simon Peyton-Jones simo...@microsoft.com wrote: (I sent this to ‘libraries’ but Kim-Ee suggested adding Café, where so many smart people hang out.) ** ** Friends ** ** Some of you will know that I’ve promised to

Re: [Haskell-cafe] Traversals of monomorphic containers

2013-09-03 Thread Tony Morris
These questions are exactly what Control.Lens answers. On 04/09/2013 12:50 PM, Mario Blažević blama...@acanac.net wrote: On 09/02/13 06:53, Nicolas Trangez wrote: # Redirected to haskell-cafe On Sun, 2013-09-01 at 14:58 +0400, Artyom Kazak wrote: Would this be an appropriate place to

Re: [Haskell-cafe] mapFst and mapSnd

2013-05-31 Thread Tony Morris
class BinaryFunctor f where bimap :: (a - c) - (b - d) - f a b - f c d mapFst = (`bimap id`) mapSnd = bimap id On 31/05/2013 12:16 PM, Shachaf Ben-Kiki shac...@gmail.com wrote: On Thu, May 30, 2013 at 7:12 PM, Shachaf Ben-Kiki shac...@gmail.com wrote: One generalization of them is to

[Haskell-cafe] LambdaJam 2013

2013-03-04 Thread Tony Morris
to the goal. So feel free to send me an email or I am on IRC (dibblego), lurking around the #haskell channel or privmsg if you like. Personally, I would love see more haskell submissions :) LambdaJam2013 call for papers: http://www.yowconference.com.au/lambdajam/Call.html -- Tony Morris http

Re: [Haskell-cafe] CoArbitrary

2013-02-10 Thread Tony Morris
g) = DoubleOp (f . g) fmap f (IntOp g) = IntOp (f . g) instance Functor FreeOp where fmap f = (=) (return . f) instance Monad FreeOp where return = Point Suspend o = f = Suspend (fmap (= f) o) Point a = f = f a -- Tony Morris http://tmorris.net

[Haskell-cafe] CoArbitrary

2013-02-08 Thread Tony Morris
the point. I found it a bit difficult to articulate and I do wonder (hope!) that others encounter similar scenarios. Thanks for any tips! -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] Control.bimap?

2012-12-12 Thread Tony Morris
the bimap function, and cabal reports no package Control.Bifunctor. ?? --- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony

Re: [Haskell-cafe] Segment Tree based Set

2012-10-29 Thread Tony Morris
, Roman Cheplyaka wrote: If you searched hackage, you'd find http://hackage.haskell.org/package/SegmentTree Roman * Tony Morris tonymor...@gmail.com [2012-10-29 15:38:07+1000] Er, oops. ...can be implemented as: \a rs - let s = Set.fromList (rs = \(a, b) - [a..b]) in a `member` s Something

Re: [Haskell-cafe] Segment Tree based Set

2012-10-29 Thread Tony Morris
Yeah that looks useful indeed. I am surprised there isn't a DIET on hackage. On Tue, Oct 30, 2012 at 3:55 AM, Stephen Tetley stephen.tet...@gmail.comwrote: Are Martin Erwig's diets anything close? http://web.engr.oregonstate.edu/~erwig/diet/ On 29 October 2012 04:48, Tony Morris tonymor

[Haskell-cafe] Segment Tree based Set

2012-10-28 Thread Tony Morris
a more appropriate data structure to store the ranges. Does such a library exist? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Segment Tree based Set

2012-10-28 Thread Tony Morris
Er, oops. ...can be implemented as: \a rs - let s = Set.fromList (rs = \(a, b) - [a..b]) in a `member` s Something like that! On Mon, Oct 29, 2012 at 2:48 PM, Tony Morris tonymor...@gmail.com wrote: Hi, I was wondering if anyone knows of a package implementing a fast lookup for an element

Re: [Haskell-cafe] foldr (.) id

2012-10-26 Thread Tony Morris
, defined in a library anywhere? I googled and hoogled, but no luck so far. Thanks, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-24 Thread Tony Morris
mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net

[Haskell-cafe] Flipping type constructors

2012-08-13 Thread Tony Morris
/TypeCompose/0.9.1/doc/html/src/Control-Compose.html#Flip I was wondering if there are any well-developed techniques to deal with this? Of course, I could just write my own Flip with the appropriate kinds and be done with it. Maybe there is a more suitable way? -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-24 Thread Tony Morris
/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Perth Functional Programmers meetup group launched

2012-06-13 Thread Tony Morris
happy to share a beer and talk about programming! For more information, visit: http://www.meetup.com/PerthFP/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http

Re: [Haskell-cafe] Unit and pair

2012-05-08 Thread Tony Morris
. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe data-lens has something similar (Tensor): http://hackage.haskell.org/packages/archive/data-lens/2.10.0/doc/html/Control-Category-Product.html -- Tony Morris http://tmorris.net

[Haskell-cafe] Haskell source AST zipper with state

2012-05-02 Thread Tony Morris
Is there a library to traverse a source AST keeping state? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Does somebody know about these functions?

2012-02-29 Thread Tony Morris
On 01/03/12 14:40, wren ng thornton wrote: Of course, you can simplify the implementation by: inter f xs = zipWith f xs (tail xs) inter f = zipWith f * tail -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Not an isomorphism, but what to call it?

2012-01-19 Thread Tony Morris
://www.haskell.org/mailman/listinfo/haskell-cafe It is not clear to me exactly what you are asking, so shot in the dark: injection or surjection? - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http

Re: [Haskell-cafe] Functor0?

2012-01-15 Thread Tony Morris
for this? A better way to do it? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ? http://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html ? -- Tony Morris http

Re: [Haskell-cafe] strict, lazy, non-strict, eager

2011-12-24 Thread Tony Morris
it intriguing, helpful, provocative and potentially helpful toward the common goal of helping others. I am interested in further commentary. I'm not scared and you shouldn't be either. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] strict, lazy, non-strict, eager

2011-12-24 Thread Tony Morris
On 24/12/11 18:41, Gregory Crosswhite wrote: On Dec 24, 2011, at 6:22 PM, Tony Morris wrote: Wait what? I find it intriguing, helpful, provocative and potentially helpful toward the common goal of helping others. I am interested in further commentary. I'm not scared and you shouldn't

[Haskell-cafe] Lens with merge (Semigroup)

2011-09-05 Thread Tony Morris
a) -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Smarter do notation

2011-09-03 Thread Tony Morris
- -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOYuR6AAoJEPxHMY3rBz0PRE8IAMK8sQTzxtgRYeWcyP6JmWso Yl3eDUjny2uMSzIkifJix/t7tYuYG092H6SvA5VhgVBPQUd8LnZH/91X3PDGANBu

Re: [Haskell-cafe] Pointed, but not Applicative

2011-08-28 Thread Tony Morris
://www.haskell.org/haskellwiki/Typeclassopedia ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Pointed f = Pointed (StateT s f) but not Applicative f = Applicative (StateT s f) - -- Tony

Re: [Haskell-cafe] Simon PJ in Australia

2011-08-19 Thread Tony Morris
. I'm as keen as Simon to meet others from further afield with similar interests. http://www.yowconference.com.au/YOW2011/general/workshopDetails.html?eventId=3552 PS: we have a significant FP community here in Brisbane with nearly 250 members http://bfpg.org/ -- Tony Morris http://tmorris.net

[Haskell-cafe] Data.Time

2011-06-25 Thread Tony Morris
Data.Time is pretty useless? If I am right, and there is no alternative, I see no option but to take an excursion into writing my own. Ultimately, I am just trying to avoid this. Tips welcome. - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux

[Haskell-cafe] Iteratee stack-consumption

2011-05-30 Thread Tony Morris
sort of chunking the enumeratee or something? I was unable to find any good general hints in any of the hackage libraries. Thanks for any pointers. - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Tony Morris
On 24/05/11 22:41, Johannes Waldmann wrote: Then tell me, why does calculating the length of a (Haskell) list has O(n) complexity. Infiniticity aside, tail would become O(n) if you store a length with each cons cell. -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Tony Morris
that. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] *GROUP HUG*

2011-05-24 Thread Tony Morris
___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] Robert Harper on monads and laziness

2011-05-02 Thread Tony Morris
that Haskell's suitability in first place has no close second place. I wonder why I am wrong, but this post (and previous) is hardly persuasive. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] Python is lazier than Haskell

2011-04-27 Thread Tony Morris
of laziness is taken into account. This is not what laziness gives us. Rather, it gives us terminating programs that would otherwise not terminate. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] How large is the Haskell community ?

2011-02-12 Thread Tony Morris
. I have not seen anywhere near 50% post here. - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1XDbEACgkQmnpgrYe6r63g7ACghYtq7+lyba3S/UscZ34+DEvx

Re: [Haskell-cafe] Generalizing catMaybes

2011-01-08 Thread Tony Morris
functors that are not monads. The paper, Applicative Programming with Effects (McBride, Paterson) lists a couple. - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

[Haskell-cafe] Generalizing catMaybes

2011-01-07 Thread Tony Morris
else's brain is molded into an appropriate shape to reveal an answer! - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0n0lwACgkQmnpgrYe6r6155gCeLjYizQ

[Haskell-cafe] UTF-8 BOM

2011-01-04 Thread Tony Morris
else s readBOMFile :: FilePath - IO String readBOMFile p = dropBOM `fmap` readFile p -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-23 Thread Tony Morris
/mailman/listinfo/haskell-cafe - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0UIJ0ACgkQmnpgrYe6r62kWgCeNwZnYLetOFevK6bpCBE/joKO 2QQAniaX4IGzAmdjEC8kdDV27upUTsBw =NP27

[Haskell-cafe] dot-ghci files

2010-12-08 Thread Tony Morris
group write on that file for some reason. I'd appreciate some comments on this issue. Thanks. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Load testing

2010-11-28 Thread Tony Morris
Does there exist a package for convenient load-testing against a website? e.g. making lots of HTTP requests against a server, including timing, and collecting the results? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] category-extras clash with transformers

2010-11-20 Thread Tony Morris
packages failed to install: category-extras-0.53.5 failed during the building phase. The exception was: ExitFailure 1 - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Re: [Haskell-cafe] category-extras clash with transformers

2010-11-20 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21/11/10 04:43, Ross Paterson wrote: On Sat, Nov 20, 2010 at 10:58:44PM +1000, Tony Morris wrote: I have installed mtl-1.1.1.0 so that xmonad-contrib-0.9.1 would compile with GHC 6.12.1. http://permalink.gmane.org/gmane.comp.lang.haskell.xmonad

Re: [Haskell-cafe] category-extras clash with transformers

2010-11-20 Thread Tony Morris
: xmonad-contrib-0.9.1 failed during the building phase. The exception was: ExitFailure 1 - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

[Haskell-cafe] Non-hackage cabal source

2010-11-02 Thread Tony Morris
to download http://myhackage/packages/package/MyPackage-0.0.1.tar.gz : ErrorMisc Unsucessful HTTP code: 404 Why is cabal even making this request? Why is it not making the request to http://myhackage/packages/MyPackage/0.0.1/MyPackage-0.0.1.tar.gz Thanks for any tips. -- Tony Morris http

Re: [Haskell-cafe] Re: Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Tony Morris
with a robust open source implementation. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Network.HTTP, BasicAuth+Headers

2010-10-04 Thread Tony Morris
to the following curl: curl --basic -u user:pass -H Accept: application/xml -H Content-type: application/xml https://host/path; It seems with Network.Browser I cannot send headers, but with Network.HTTP I cannot see how to send the BasicAuth information. Any tips are appreciated. -- Tony Morris

Re: [Haskell-cafe] Unwrapping newtypes

2010-09-08 Thread Tony Morris
on a more generic type? Kevin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Unwrapping newtypes

2010-09-08 Thread Tony Morris
that extension? Here is an example: {-# LANGUAGE GeneralizedNewtypeDeriving #-} class C a where c :: a - Int data G = G instance C G where c _ = 7 newtype H = H G deriving C -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell

[Haskell-cafe] lambdacats

2010-08-05 Thread Tony Morris
Hello, does anyone happen to have the lambdacats page cached? The domain ( arcanux.org) and server have disappeared and the wayback machine doesn't have the images. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] lambdacats

2010-08-05 Thread Tony Morris
I wonder if the original site is recoverable from this, but I suspect there are some missing. On Fri, Aug 6, 2010 at 2:33 PM, Don Stewart d...@galois.com wrote: ivan.miljenovic: On 6 August 2010 14:12, Tony Morris tonymor...@gmail.com wrote: Hello, does anyone happen to have the lambdacats

[Haskell-cafe] Monad transformers, design

2010-07-31 Thread Tony Morris
a) = Ints (InterT m a) where ints (InterT a) = ints (copoint a) {- So it seems that for some type-classes it is possible to implement for both the data type and the transformer, but not all type-classes. Is there a general approach to this problem? -} -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Monad transformers, design

2010-07-31 Thread Tony Morris
gah you're right, @mtl had confuzzled me. Well that changes things then, thanks. Ross Paterson wrote: On Sat, Jul 31, 2010 at 10:56:31PM +1000, Tony Morris wrote: -- Suppose some data type newtype Inter a = Inter (Int - a) -- and a monad transformer for that data type. newtype InterT m

Re: [Haskell-cafe] Type-Level Programming

2010-06-26 Thread Tony Morris
-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Retrospective type-class extension

2010-05-20 Thread Tony Morris
Ivan Miljenovic wrote: On 20 May 2010 14:42, Tony Morris tonymor...@gmail.com wrote: We all know that class (Functor f) = Monad f is preferable but its absence is a historical mistake. We've all probably tried once: instance (Functor f) = Monad f where Do you mean the reverse

Re: [Haskell-cafe] Retrospective type-class extension

2010-05-20 Thread Tony Morris
) = Monad f where join :: f (f a) - f a This would be a great idea, for the sake of logic, first (a monad which is not a functor doesn't make sense), and also to eliminate redudancy (fmap = liftM, ap = (*), etc.) 2010/5/20 Tony Morris tonymor...@gmail.com mailto:tonymor...@gmail.com

[Haskell-cafe] Retrospective type-class extension

2010-05-19 Thread Tony Morris
such a notion? Ideally something like this would be handy if it could somehow be retrospectively applied: Monad - Applicative - Pointed - Functor -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] What is the meaning of tilde (~) symbol

2010-02-14 Thread Tony Morris
any instances: http://hackage.haskell.org/package/algebra I do too. I also wish there was an associative: class F f where k :: f a - f a - f a without the zero component. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell

[Haskell-cafe] Lazy language on JVM/CLR

2010-02-08 Thread Tony Morris
as pure, lazy programming to run on the JVM in Java and Scala programming languages. I expect others have forethought and perhaps even experimented with such a language. Are there any dangers to be wary of that undo the entire endeavour? Thanks for any insights. -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Maybe, maybe not.

2010-01-26 Thread Tony Morris
with that type, as far as I can see :) Is the other one... const? As far as I can tell, yes. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Maybe, maybe not.

2010-01-26 Thread Tony Morris
Ivan Miljenovic wrote: 2010/1/27 Tony Morris tonymor...@gmail.com: It might be more obvious by giving: fromMaybe :: a - (a - x, x) - x I actually found this more confusing, and am not sure of its validity: should that be Maybe a there at the beginning? Sorry a mistake

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Tony Morris
rearrange this, it *insists* that there's a parse error. This is very frustrating, given that it's utterly clear what I want... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony

Re: [Haskell-cafe] Language simplicity

2010-01-12 Thread Tony Morris
@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Java has 53 reserved words. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ghc -e

2010-01-06 Thread Tony Morris
Can I import a module when using ghc -e? e.g. ghc -e import Control.Monad; forM [[1,2,3]] reverse -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ghc -e

2010-01-06 Thread Tony Morris
Gwern Branwen wrote: On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris tonymor...@gmail.com wrote: ghc -e import Control.Monad; forM [[1,2,3]] reverse As of 6.10.2, the bug whereby the GHC API lets you use functions from anywhere just by naming them (Java-style) has not been fixed

[Haskell-cafe] (liftM join .) . mapM

2009-12-29 Thread Tony Morris
Can (liftM join .) . mapM be improved? (Monad m) = (a - m [b]) - [a] - m [b] -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Children elements with HXT

2009-12-22 Thread Tony Morris
(xunpickleDocument xpWay [] way.xml) [Way {tags = []}] Why is the tags list empty instead of holding two entries? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Children elements with HXT

2009-12-22 Thread Tony Morris
Adding (a_remove_whitespace,v_1) as a parser option when running solves it. Silly me. Tony Morris wrote: I am trying to parse XML using HXT following http://www.haskell.org/haskellwiki/HXT/Conversion_of_Haskell_data_from/to_XML Here is my XML file (way.xml): way id=27776903 visible=true

Re: [Haskell-cafe] Finding HP

2009-12-03 Thread Tony Morris
is not a particularly nice response. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Tony Morris
. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Working with multiple projects

2009-11-11 Thread Tony Morris
I don't want to have to upload every time I make a minor change as I am working. Surely there is an easier way. Martijn van Steenbergen wrote: Tony Morris wrote: I have two projects that I intend to put on hackage soon. One depends on the other. I have cabaled both. I am wondering how others

[Haskell-cafe] Working with multiple projects

2009-11-10 Thread Tony Morris
I have two projects that I intend to put on hackage soon. One depends on the other. I have cabaled both. I am wondering how others work with this kind of set up where changes are made to both libraries as they work. -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Applicative but not Monad

2009-10-30 Thread Tony Morris
http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-30 Thread Tony Morris
on.) cjs -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Comments requested: succ Java

2009-09-29 Thread Tony Morris
John A. De Goes wrote: write them yourself (at a cost of several to dozens of man years), Is that right? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-28 Thread Tony Morris
- a package manager Thoughts? -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Library function for map+append

2009-08-18 Thread Tony Morris
___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe mapapp = ((++) .) . map Reasoning about efficiency in a pure lazy language is different. -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-06-30 Thread Tony Morris
is pretty excellent. I happen to agree. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] List spine traversal

2009-06-28 Thread Tony Morris
Is there a canonical function for traversing the spine of a list? I could use e.g. (seq . length) but this feels dirty, so I have foldl' (const . const $ ()) () which still doesn't feel right. What's the typical means of doing this? -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] I need a hint in list processing

2009-06-14 Thread Tony Morris
Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] I need a hint in list processing

2009-06-14 Thread Tony Morris
Just guessing. How do you know it's an accident? Richard O'Keefe wrote: On 15 Jun 2009, at 4:26 pm, Tony Morris wrote: Prelude Data.List nub . concat $ [[2, 3], [1, 2], [2, 3, 4], [1, 2, 3]] [2,3,1,4] In this particular case. But that's a lucky accident.\ -- Tony Morris http

Re: [Haskell-cafe] When folding is there a way to pick out the last point being processed?

2009-06-11 Thread Tony Morris
___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] Re: Non Empty List?

2009-06-04 Thread Tony Morris
___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] instance Monad (Except err)

2009-05-04 Thread Tony Morris
://www.haskell.org/mailman/listinfo/haskell-cafe I'm sure you could, but then ap /= (*). This seems related to a question that I once asked http://www.haskell.org/pipermail/haskell-cafe/2009-January/054139.html -- Tony Morris http://tmorris.net/ ___ Haskell

Re: [Haskell-cafe] instance Monad (Except err)

2009-05-04 Thread Tony Morris
, Neil. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Combining computations

2009-05-03 Thread Tony Morris
functions. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] name for monad-like structure?

2009-04-28 Thread Tony Morris
Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Are you sure it supports () :: m a - m b - m b and not mplus :: m a - m a - m a ? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread Tony Morris
+ (safeDivision 10 5) *Main Data.List ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http

Re: [Haskell-cafe] Monad explanation

2009-02-09 Thread Tony Morris
signature of a value. getChar has the signature RealWorld - (RealWorld, Char) - -- Tony Morris http://tmorris.net/ * * Anteromedial Heterotopic Osseous Impingement Syndrome * * http

Re: [Haskell-cafe] Monad explanation

2009-02-09 Thread Tony Morris
. -- Lennart On Mon, Feb 9, 2009 at 10:26 AM, Tony Morris tmor...@tmorris.net wrote: Gregg Reynolds wrote: The point being that the metalanguage commonly used to describe IO in Haskell contains a logical contradiction. A thing cannot be both a value and a function, but e,g, getChar behaves

Re: [Haskell-cafe] Monad explanation

2009-02-09 Thread Tony Morris
with the top level it will be executed. But the fact that IO types also behave as values makes Haskell a very powerful imperative language. On Mon, Feb 9, 2009 at 11:14 AM, Tony Morris tmor...@tmorris.net wrote: You're right - my statement is inaccurate. Implementation details aside, I am

Re: [Haskell-cafe] Function const (Binding)

2009-02-07 Thread Tony Morris
-- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe - -- Tony Morris http://tmorris.net/ * Anteromedial Osseous Impingement

[Haskell-cafe] Applicative/Monad for Either

2009-01-21 Thread Tony Morris
e1)) * (Z (Right _)) = Z (Left e1) (Z (Right _)) * (Z (Left e2)) = Z (Left e2) (Z (Right f)) * (Z (Right a)) = Z (Right (f a)) instance (Monoid e) = Monad (Z e) where return = pure (Z e) = f = error todo -- ? - -- Tony Morris http://tmorris.net/ S, K and I ought to be enough for anybody

Re: [Haskell-cafe] Function composition

2008-12-26 Thread Tony Morris
@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe - -- Tony Morris http://tmorris.net/ S, K and I ought to be enough for anybody. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Re: [Haskell-cafe] About do notation.

2008-10-14 Thread Tony Morris
is the () and (=) way of this. Thanks. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe getArgs = (\a - getLine = (\b - myFunc1 (head a) b myFunc2 b (head a))) - -- Tony Morris http://tmorris.net

Re: [Haskell-cafe] Having trouble with zip12..

2008-07-06 Thread Tony Morris
idempotent? lambdabot OK, passed 500 tests. - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIcS9LmnpgrYe6r60RAiDOAKCJlDaqNd5ssgxrUrrHee75WGzhbgCfftdn 70+4isXh4zaoYly0da2Gdk8

Re: [Haskell-cafe] zlib, missing zlib.h

2008-05-30 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 apt-get install zlib1g-dev Tony Morris http://tmorris.net/ Real-world problems are simply degenerate cases of pure mathematical problems. Thomas Hartman wrote: Tried to install http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib

[Haskell-cafe] lambdabot on GHC 6.8.2

2008-05-20 Thread Tony Morris
) against GHC 6.8.2. Am I hitting this bug? If so, can I get around it to get a working lambdabot? Thanks for any tips. - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

[Haskell-cafe] Test.QuickCheck.Gen

2008-05-01 Thread Tony Morris
is acceptable. I'm seeking comments about this, thanks! - -- Tony Morris http://tmorris.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIGjO6mnpgrYe6r60RAtohAKCBsl1lHxuNrBaLHuqwCN58PBHCIACbBALk YWkBkw9o9NUQbr

Re: [Haskell-cafe] haskellwiki and Project Euler

2008-02-23 Thread Tony Morris
You're going the right way about having the answers published in more ways than just the Haskell wiki. I'm only making a prediction, not a threat. -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

  1   2   >