[Haskell-cafe] Strict Core?

2010-10-15 Thread Gregory Crosswhite
Hey everyone, 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? Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Strict Core?

2010-10-15 Thread Gregory Crosswhite
Yes, I had seen this paper before and wondered the same thing at the time, but it was only just now when you brought the paper up that I realized I could ask people about it here. :-) On 10/15/2010 03:01 PM, Andrew Coppin wrote: On 15/10/2010 10:27 PM, Gregory Crosswhite wrote: Hey

Re: [Haskell-cafe] An interesting paper on VM-friendly GC

2010-10-15 Thread Gregory Crosswhite
On 10/15/2010 03:15 PM, Andrew Coppin wrote: On the other hand, their implementation uses a modified Linux kernel, and no sane person is going to recompile their OS kernel with a custom patch just to run Haskell applications, so we can't do quite as well as they did. But still, and

Re: [Haskell-cafe] ANNOUNCE: type-level-natural-number and friends!

2010-10-14 Thread Gregory Crosswhite
On 10/14/10 1:35 AM, Henning Thielemann wrote: Gregory Crosswhite schrieb: === natural-number v1.0 === This package provides *value*-level natural numbers that are tagged with a type-level natural number corresponding to their value by using GADTs, as well as some simple operations on them

Re: [Haskell-cafe] ANNOUNCE: tagged-list v1.0

2010-10-14 Thread Gregory Crosswhite
On 10/14/10 1:15 AM, Jonas Almström Duregård wrote: [...] Also, what is UntaggedList used for, and how is it different from []. /J UntaggedList makes it easy for you do things like the following: processListAsTaggedList :: [a] - (forall n. TaggedList n a - b) - b

Re: [Haskell-cafe] ANNOUNCE: type-level-natural-number and friends!

2010-10-14 Thread Gregory Crosswhite
On 10/14/10 11:07 AM, Henning Thielemann wrote: Gregory Crosswhite schrieb: On 10/14/10 1:35 AM, Henning Thielemann wrote: Is there also a 'reify' function, that allows to convert an Int or Peano value locally to a type level number? reifyInteger :: Integer - (forall n. Nat n = n

[Haskell-cafe] ANNOUNCE: type-level-natural-number and friends!

2010-10-13 Thread Gregory Crosswhite
Hey everyone, I am pleased to announce the release of a family of packages for type-level natural numbers. The emphasis on these packages is minimality in order to provide simple core functionality that requires as few extensions as possible beyond Haskell-2010. The (probably foolish)

[Haskell-cafe] ANNOUNCE: tagged-list v1.0

2010-10-13 Thread Gregory Crosswhite
Hey everyone, I am pleased to announce the release of tagged-list version 1.0, a package which provides fixed-length lists that are tagged with a phantom type-level natural number corresponding to the length. The advantage of such lists is that you can make static guarantees about them, so

Re: Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-12 Thread Gregory Crosswhite
On 10/12/10 5:56 AM, Uwe Schmidt wrote: Hi Gregory, As I understood, John Hughes invented the arrows as a generalisation of monads, you say it's a less powerful concept. I'm a bit puzzled with that. Could you explain these different views. Consider the following example: f :: Int - m a

Re: Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-12 Thread Gregory Crosswhite
On 10/12/10 12:39 PM, Gene A wrote: splitMiddle :: forall a. [a] - ([a], [a]) splitMiddle = (id (length flip div 2)) (\(xs,a) - splitAt a xs) But is that really easier to understand at a glance then splitMiddle xs = splitAt (length xs `div` 2) xs ? It seems to me that while

Re: Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-12 Thread Gregory Crosswhite
On 10/12/10 6:29 AM, Sebastiaan Visser wrote: Gregory, I use arrows (especially list arrows) in a lot of my projects and find them (after some training) easier to work with than monands. Code that I write point-free using arrows generally contains fewer bugs than code I write in monadic

Re: Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-12 Thread Gregory Crosswhite
On 10/12/10 1:22 PM, Dan Doel wrote: On Tuesday 12 October 2010 4:02:06 pm Gregory Crosswhite wrote: Hughes himself said that when your arrow is an instance of ArrowApply, you are better off just sticking with monads. Well, this is not necessarily good advice. It is true that ArrowApply

Re: Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-11 Thread Gregory Crosswhite
Uwe, Thank you for your reply. On 10/11/10 6:20 AM, Uwe Schmidt wrote: I thing, this is not a question of functionality, it's a question of style. Of course everything in hxt could have been done with monads, but does this also mean: Everything must have been done with monads? No, but there

Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-07 Thread Gregory Crosswhite
Could you explain to me why HXT uses arrows? I have never been able to figure out what advantage this gives your library over monads. Since your arrows in practice implement ArrowApply, they are really just monads anyway, so it seems to me that using arrows instead of monads only serves to

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Gregory Crosswhite
On 10/06/10 13:32, steffen wrote: A slightly different suggestion from Simon PJ and myself (we agreed on something syntax-related :-) is the following: \case 1 - f 2 - g ... \case { 1 - f; 2 - g } +1 I like this because it has exactly the same properties of Max's case-of, but

Re: [Haskell-cafe] Suggestions for improvement

2010-10-03 Thread Gregory Crosswhite
On 10/3/10 1:45 PM, Dominique Devriese wrote: Additionally, you can't combine the functions (blowup . allButLast) and lastToTheLength into a function that returns a pair like you seem to attempt. You need a function like the following for that: comma :: (a - b) - (a - c) - a - (b,c) comma

Re: [Haskell-cafe] Suggestions for improvement

2010-10-03 Thread Gregory Crosswhite
On 10/3/10 2:24 PM, Dominique Devriese wrote: Or you can write it as (liftA2 (,)) as I noted a few lines further in my mail ;) Dominique I know, I just mentioned it to increase awareness of the fact that the instance methods for all the classes in Control.Arrow can equivalently be

[Haskell-cafe] Applicative instances for Monads

2010-09-24 Thread Gregory Crosswhite
Hey everyone, There is something that has been bugging me recently about the Applicative class and the Monad class. Any type constructor F that is a Monad has a natural Applicative instance, ($) :: F (a - b) - F a - F b mf $ ma = do f - mf a - ma return (f a)

Re: [Haskell-cafe] Re: Ultra-newbie Question

2010-09-18 Thread Gregory Crosswhite
Translation: Look at Data.Sequence sometime. On 9/18/10 11:15 AM, Maciej Piechotka wrote: On Sat, 2010-09-18 at 03:51 -0400, Christopher Tauss wrote: Hello Haskell Community - I am a professional programmer with 11 years experience, yet I just do not seem to be able to get the hang of even

Re: [Haskell-cafe] Re: Ultra-newbie Question

2010-09-18 Thread Gregory Crosswhite
Translation: Look at Data.Sequence sometime. On 9/18/10 11:15 AM, Maciej Piechotka wrote: On Sat, 2010-09-18 at 03:51 -0400, Christopher Tauss wrote: Hello Haskell Community - I am a professional programmer with 11 years experience, yet I just do not seem to be able to get the hang of even

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Gregory Crosswhite
On 9/15/10 1:31 AM, Malcolm Wallace wrote: [...] However, Template Haskell is ghc-only, and is unlikely ever to be implemented by any other Haskell compiler. [...] Could it be implemented as a separate preprocessor? Cheers, Greg ___ Haskell-Cafe

Re: [Haskell-cafe] try, seq, and IO

2010-09-15 Thread Gregory Crosswhite
Check out the evaluate function in Control.Exception. Also note that if you apply seq to an IO action, you do *not* force the result, only the action that will eventually produce the result. Cheers, Greg On 9/15/10 2:13 AM, Jeroen van Maanen wrote: The past year I have been working on a

Re: [Haskell-cafe] Re: ANNOUNCE: GotoT-transformers version 1.0

2010-09-12 Thread Gregory Crosswhite
On 9/11/10 10:36 PM, Ertugrul Soeylemez wrote: It should print the string, if the computation isn't aborted, i.e. if the last continuation, which you specify as an argument to runContT is reached. Greets, Ertugrul That's true, it just seems to me like at that point the spirit of the

Re: [Haskell-cafe] Re: ANNOUNCE: GotoT-transformers version 1.0

2010-09-11 Thread Gregory Crosswhite
To recover from my overly complex previous post, here is a much simply goto based on existing monad transformers: goto :: Monad m = ContT r m r - ContT r m a goto (ContT m) = ContT $ \_ - m return That doesn't actually work, though. Try running the following script:

Re: [Haskell-cafe] Re: ANNOUNCE: GotoT-transformers version 1.0

2010-09-11 Thread Gregory Crosswhite
this string!) Then the program will be eternally disappointed because it will never actually get to print that string at the end. On 9/11/10 6:16 PM, Gregory Crosswhite wrote: To recover from my overly complex previous post, here is a much simply goto based on existing monad transformers: goto

Re: [Haskell-cafe] ANNOUNCE: AbortT-transformers version 1.0

2010-09-08 Thread Gregory Crosswhite
On 09/08/10 12:54, Henning Thielemann wrote: Gregory Crosswhite schrieb: For whatever reason, nobody seems to have gotten around to implementing an Abort monad transformer (outside the monadLib package), so I decided to write one myself since I wanted the functionality but I use

Re: [Haskell-cafe] ANNOUNCE: GotoT-transformers version 1.0

2010-09-08 Thread Gregory Crosswhite
On 09/08/10 12:55, Henning Thielemann wrote: Gregory Crosswhite schrieb: People want to believe that Haskell is a better language than C, but how could this possibly be true when Haskell lacks the very basic goto feature??? If the world is going to take Haskell seriously, then this serious

Re: [Haskell-cafe] Re: ANNOUNCE: GotoT-transformers version 1.0

2010-09-08 Thread Gregory Crosswhite
On 09/08/10 19:14, Ertugrul Soeylemez wrote: Gregory Crosswhite gcr...@phys.washington.edu wrote: People want to believe that Haskell is a better language than C, but how could this possibly be true when Haskell lacks the very basic goto feature??? If the world is going to take Haskell

[Haskell-cafe] ANNOUNCE: GotoT-transformers version 1.0

2010-09-03 Thread Gregory Crosswhite
People want to believe that Haskell is a better language than C, but how could this possibly be true when Haskell lacks the very basic goto feature??? If the world is going to take Haskell seriously, then this serious blight needs to be addressed immediately! Thus I proud to present to you the

[Haskell-cafe] ANNOUNCE: AbortT-transformers version 1.0

2010-09-03 Thread Gregory Crosswhite
For whatever reason, nobody seems to have gotten around to implementing an Abort monad transformer (outside the monadLib package), so I decided to write one myself since I wanted the functionality but I use transformers rather than monadLib. An abortable monadic computation runs until either it

Re: [Haskell-cafe] creating a type based on a string

2010-09-02 Thread Gregory Crosswhite
What is stopping you from using an enumeration type? data Tag = A | B data X = X String Tag op a = X a A op b = X b B On 9/2/10 1:31 PM, Andrew U. Frank wrote: I have a user input (string) and need to select one of two types. depending what the input is. is this possible? data A data B

Re: [Haskell-cafe] Re: philosophy of Haskell

2010-08-18 Thread Gregory Crosswhite
On 08/18/10 11:30, Dan Doel wrote: Now, moving to the two loops: loop = loop loop' = \w0 - let (w1, ()) = putStr c w0 in loop' w1 How are we to distinguish between these? I know of exactly one Haskell function that can do so: seq. And this is only because it can distinguish bottom

Re: [Haskell-cafe] Re: philosophy of Haskell

2010-08-18 Thread Gregory Crosswhite
On 08/18/10 11:30, Dan Doel wrote: By contrast, here: http://code.haskell.org/~dolio/agda-share/html/IOE.html is a term model of IO. It's in Agda, for some proofs, but it's easily done in GHC. And if we write the above loops in this model, we get: loop = loop ==

Re: [Haskell-cafe] Re: philosophy of Haskell

2010-08-18 Thread Gregory Crosswhite
On 08/18/10 12:04, Gregory Crosswhite wrote: Now we have that loop' = loop''. Oops! I meant that loop' = loop'' in the world passing model, so that if loop' = \w0 - let (w1, ()) = putStr c w0 in loop' w1 loop'' = \w0 - let (w1, ()) = putStr c w1 in loop' w1 then loop' = loop

Re: [Haskell-cafe] More Flexible Monad Transformer OR Bad Coding Style

2010-08-09 Thread Gregory Crosswhite
I've never used this myself, but the package mtlx seems to offer one possible solution to this problem by tagging the monad transformers with index types: http://hackage.haskell.org/package/mtlx Cheers, Greg On 08/09/10 12:39, Gábor Lehel wrote: Actually, while I haven't even used monad

Re: [Haskell-cafe] Suggestions For An Intro To Monads Talk.

2010-08-06 Thread Gregory Crosswhite
It might be a little late at this point, but here's my take on monads: In most imperative languages sequencing of statements is a feature that is hard-coded into the language to act in a certain way, e.g. to have a particular implicit state (the global state plus possibly the fields available

Re: [Haskell-cafe] Playing with ATs again

2010-08-05 Thread Gregory Crosswhite
On 8/4/10 11:40 PM, Andrew Coppin wrote: Ivan Lazar Miljenovic wrote: Don't forget, GHC is open source: if this lack really was dumb and annoying you, there was nothing stopping you from rectifying this situation up until now. Except that, in the real world, this is actually completely

Re: [Haskell-cafe] ANNOUNCE: DSTM 0.1.1

2010-08-05 Thread Gregory Crosswhite
, Greg On 8/5/10 7:52 AM, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/5/10 00:47 , Gregory Crosswhite wrote: The documentation is a little confusing on this issue. It sounded to me when I read the documentation that all of the *OS* threads were blocked

Re: [Haskell-cafe] ANNOUNCE: DSTM 0.1.1

2010-08-04 Thread Gregory Crosswhite
The documentation is a little confusing on this issue. It sounded to me when I read the documentation that all of the *OS* threads were blocked by the FFI, when what was meant was that all of the *IO* threads assigned to the calling OS thread are what is blocked, because the docs just say

Re: [Haskell-cafe] ANNOUNCE: approximate-equality 1.0 -- Newtype wrappers for approximate equality

2010-08-03 Thread Gregory Crosswhite
On 8/3/10 3:27 AM, Neil Brown wrote: So you can get the same function without needing to add a type-class. Or is it that you envisage other tolerance specifications besides Digit? If so, I wonder if this flexibility complicates your API unnecessarily. If you removed those type-classes and

[Haskell-cafe] Why do unsafe foreign calls block other threads?

2010-08-03 Thread Gregory Crosswhite
Hey everyone, Could someone explain to me the logic behind having unsafe calls block other threads from executing? It seems to me that if anything it would make more sense for safe calls to block other threads since the call can call back into the Haskell runtime, as opposed to unsafe calls

Re: [Haskell-cafe] Why do unsafe foreign calls block other threads?

2010-08-03 Thread Gregory Crosswhite
that the function you're calling is unsafe (i.e., can call back into Haskell) then it blocks the world. But I do think it's unintuitive and a less ambiguous naming scheme would be nicer. Dan On Tue, Aug 3, 2010 at 11:54 PM, Gregory Crosswhite gcr...@phys.washington.edu mailto:gcr

Re: [Haskell-cafe] Why do unsafe foreign calls block other threads?

2010-08-03 Thread Gregory Crosswhite
On 08/03/10 15:22, Evan Laforge wrote: On Tue, Aug 3, 2010 at 3:06 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: But you've got it backwards: if the function I am calling can call back into Haskell (i.e., is marked as safe), then GHC *doesn't* block the world, but if the function

Re: [Haskell-cafe] Why do unsafe foreign calls block other threads?

2010-08-03 Thread Gregory Crosswhite
On 08/03/10 15:23, John Meacham wrote: It is more an accident of ghc's design than anything, the same mechanism that allowed threads to call back into the runtime also allowed them to be non blocking so the previously used 'safe' and 'unsafe' terms got re-used. personally, I really don't like

Re: [Haskell-cafe] Why do unsafe foreign calls block other threads?

2010-08-03 Thread Gregory Crosswhite
On 08/03/10 15:33, Evan Laforge wrote: Just think of unsafe in relation to unsafeIndex or something. It's faster, but you have to be sure the index is in bounds. Yes, but the whole reason to use unsafe is to get higher performance at the cost of safety. If the result of calling an unsafe

Re: [Haskell-cafe] Why do unsafe foreign calls block other threads?

2010-08-03 Thread Gregory Crosswhite
threads and the haskell threads mapped to them are not blocked, afaik. safe calls spawn a new OS thread (maybe reuse an existing one if available?), move the haskell threads over, (do various other housekeeping?), and then make the call. On Wed, Aug 4, 2010 at 12:41 AM, Gregory Crosswhite

Re: [Haskell-cafe] ANNOUNCE: Takusen 0.8.6

2010-08-01 Thread Gregory Crosswhite
On 8/1/10 12:12 PM, austin seipp wrote: Hi Jason, I've had my eye on the 'Takusen' approach for a while. In particular I think it's a wonderful idea to use the left-fold based interface. Takusen is also well supported and pretty stable, having been around for a while. I agree; in fact, I

Re: [Haskell-cafe] Definition of List type?

2010-07-30 Thread Gregory Crosswhite
List are actually built in to the language, but they are roughly equivalent to the following definition: data List a = [] | a:List a The reason why this definition never actually appears is because it defines the constructors using operators rather than names, which is not allowed in

[Haskell-cafe] Announce type-level-natural-number-1.0: Simple, Haskell 2010-compatible type level natural numbers

2010-07-30 Thread Gregory Crosswhite
feedback that the community has to offer. Cheers, Gregory Crosswhite ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Gregory Crosswhite
It is for the very annoying reason that in order for Error to be a monad it has to implement the fail method, which means it has to know how to turn an arbitrary string into a value of your error type. Cheers, Greg On 07/27/10 15:32, Gerald Gutierrez wrote: Reading the Control.Monad.Error

[Haskell-cafe] datatype contexts

2010-07-26 Thread Gregory Crosswhite
I agree with prior discussion on this list that adding contexts to datatype declarations seems to be more trouble than its worth, since these contexts just have to be added again to every function using the datatype. However, I have often wondered: why do function *have* to have these

Re: [Haskell-cafe] datatype contexts

2010-07-26 Thread Gregory Crosswhite
of the datatype has having another field which is proof that a is a member of C: {-# LANGUAGE ExistentialQuantification #-} data T2 a = C a = D2 a -- D2 :: C a = a - T2 a -- same as D1 bar :: T2 a - Int bar (D2 a) = runC a -- works -- ryan On Mon, Jul 26, 2010 at 7:48 AM, Gregory

[Haskell-cafe] Instances for Set of Functor, Traversable?

2010-07-26 Thread Gregory Crosswhite
Is there a specific reason why Set doesn't have instances for Functor and Traversable? Or have they just not been written yet? :-) Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] RE: Design for 2010.2.x series Haskell Platform site (Don Stewart)

2010-07-17 Thread Gregory Crosswhite
Yes, but our freshly compiled binaries have far more nutrients then your factory produced ones! Besides, the world would be a far better place if everyone compiled local rather than having binaries shipped to them from half-way across the globe... On 7/17/10 4:08 PM, Miguel Mitrofanov

Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Gregory Crosswhite
Or you can get the best of all worlds by combining all three! data User = User {userNext :: IORef (MVar (TVar User))) ,userPrev :: IORef (MVar (TVar User))) } On 07/14/10 14:39, Andrew Coppin wrote: Serguey Zefirov wrote: Use IORef. ;) PS MVar is better,

Re: [Haskell-cafe] Collecting MonadError errors generically

2010-07-13 Thread Gregory Crosswhite
Leon, In order to avoid the short-circuiting behaviour, it might help you to work in terms of Applicatives instead of Monads. For example, in my error-message package I have the following instance: instance (Monoid e) = Applicative (Either e) where pure = Right (*) (Left error2) (Left

[Haskell-cafe] DpH/repa cache locality

2010-07-12 Thread Gregory Crosswhite
Hey everyone, Just out of curiosity, what work is being done in the data parallel haskell / repa projects regarding cache locality? The reason I am asking is because, as I understand it, the biggest bottleneck on today's processors are cache misses, and the reason why optimized platform-specific

Re: [Haskell-cafe] Re: Memoization in Haskell?

2010-07-09 Thread Gregory Crosswhite
space and time efficient option is to use a trie like in MemoTrie. Cheers, Greg On 7/9/10 12:50 AM, Heinrich Apfelmus wrote: Gregory Crosswhite wrote: You're correct in pointing out that f uses memoization inside of itself to cache the intermediate values that it commutes, but those values don't

Re: [Haskell-cafe] Comments on Haskell 2010 Report

2010-07-09 Thread Gregory Crosswhite
I don't know what the rule is, but I personally just replace i.e. with that is and e.g. with for example in my head, and then apply whatever punctuation makes sense with those substitutions. Cheers, Greg On 7/9/10 12:17 PM, Sean Leather wrote: On Fri, Jul 9, 2010 at 18:35, Steve Schafer

Re: [Haskell-cafe] Memoization in Haskell?

2010-07-08 Thread Gregory Crosswhite
On 7/8/10 9:17 PM, Michael Mossey wrote: Daniel Fischer wrote: If f has the appropriate type and the base case is f 0 = 0, module Memo where import Data.Array f :: (Integral a, Ord a, Ix a) = a - a f n = memo ! n where memo = array (0,n) $ (0,0) :[(i, max i (memo!(i

Re: [Haskell-cafe] Memoization in Haskell?

2010-07-08 Thread Gregory Crosswhite
) is encountered several times in the recursive branching, it would be computed several times. Am I wrong? Thanks, Mike Gregory Crosswhite wrote: On 7/8/10 9:17 PM, Michael Mossey wrote: Daniel Fischer wrote: If f has the appropriate type and the base case is f 0 = 0, module Memo where import

Re: [Haskell-cafe] Merge hsql and HDBC -- there can only be one!

2010-07-07 Thread Gregory Crosswhite
I've been using Takusen for all of my database needs, which most of the time means interfacing to a PostgreSQL database, and it has worked out pretty well in practice. In fact, I experimented with hsql and HDBC a while back and for some reason I can't remember they turned out to be less

[Haskell-cafe] Transformers versus monadLib versus...

2010-07-05 Thread Gregory Crosswhite
Hey everyone, What is the current state regarding transformers versus monadLib versus mmtl versus ... etc.? Transformers seems to be the blessed replacement for mtl, so when is it worthwhile to use the other libraries instead? It hadn't even occurred to me to look closely at packages other than

[Haskell-cafe] Transformers versus monadLib versus...

2010-07-05 Thread Gregory Crosswhite
Hey everyone, What is the current state of opinion regarding transformers versus monadLib versus mmtl versus ... etc.? Transformers seems to be the blessed replacement for mtl, so when is it worthwhile to use the other libraries instead? (It hadn't even occurred to me to look closely at

Re: [Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-02 Thread Gregory Crosswhite
On 7/2/10 11:01 AM, Brandon S Allbery KF8NH wrote: Although now that I think about it, if we're just appending to the state, this should possibly be a Writer instead of a State; the interface is simpler. The problem with this approach is that the hash context isn't a monoid; you can

Re: [Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-02 Thread Gregory Crosswhite
On 7/2/10 5:16 AM, Vincent Hanquez wrote: It's necessary in my case since i receive chunks of data to be hashed from the network, and I don't want to carry a buffer of data (with potential security issues), until i can hash everything. As an aside, this kind of pattern where you are

Re: [Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-02 Thread Gregory Crosswhite
On 7/2/10 9:13 PM, Brandon S Allbery KF8NH wrote: If you read the example code I posted, the point was how to turn the current monolithic hash function into a cumulative one by using Writer. As such, there's no opaque hash state inside the Writer. (see `hash . runWriter'). You can do

Re: [Haskell-cafe] Type-Level Programming

2010-06-25 Thread Gregory Crosswhite
Are any of those compatible with Haskell, so that we could mix code in that language with Haskell code? Cheers, Greg On 6/25/10 9:49 PM, wren ng thornton wrote: Jason Dagit wrote: On Fri, Jun 25, 2010 at 2:26 PM, Walt Rorie-Baety black.m...@gmail.comwrote: I've noticed over the - okay,

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-24 Thread Gregory Crosswhite
On 6/23/10 10:06 PM, Duncan Coutts wrote: Suppose both the zlib and tar packages specify build-depends: bytestring-0.9.*. It's entirely possible for me to install zlib, then upgrade to a new bugfix release of bytestring, install tar (using the new bytestring) and then build htar depending on

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-23 Thread Gregory Crosswhite
On 6/23/10 2:13 PM, Edward Kmett wrote: On Tue, Jun 22, 2010 at 4:54 PM, Gregory Crosswhite gcr...@phys.washington.edu mailto:gcr...@phys.washington.edu wrote: There is no reason that your program couldn't link to multiple versions of the same package so that each library can access

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-23 Thread Gregory Crosswhite
On 6/23/10 3:29 PM, Edward Kmett wrote: Yes, and that problem still isn't resolved in another since, since they share the same module names, but as of yet, still provide an incompatible API. I can't (yet) provide 'RightSemiNearRing' instances that work with both the monad transformers from

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-23 Thread Gregory Crosswhite
On 6/23/10 8:06 PM, Duncan Coutts wrote: Consider an example where we want to avoid using two versions of a dependency: The htar program depends on the tar and zlib packages. The tar and zlib packages depend on bytestring. Both tar and zlib export functions that use the type ByteString. The

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-22 Thread Gregory Crosswhite
they want to use a library that used fc-labels internally with another library that used mtl internally. It fragments the library base that you are able to use. Version caps are not the answer. -Edward Kmett On Tue, Jun 8, 2010 at 2:21 PM, Gregory Crosswhite gcr...@phys.washington.edu mailto:gcr

[Haskell-cafe] Control.Alternative --- some and many?

2010-06-22 Thread Gregory Crosswhite
Hey everyone, Could someone explain to me (or point me to a reference explaining) the purpose of the some and many methods of the Alternative class? Also, there is a link posted in the documentation for Control.Applicative to a paper which describes the motivation behind the Applicative

Re: [Haskell-cafe] Similarities between web programming and functional programming

2010-06-12 Thread Gregory Crosswhite
Unless you are using a framework like Twisted, where all potentially blocking operations are handled by passing in a function to be called when the operation is complete, so that the stack trace is non-existent. This way you get both the joy of working with a language where simple mistakes

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-08 Thread Gregory Crosswhite
Or you just put an upper bound on the versions of the fgl library that your program will build against, as you should be doing anyway, and then nothing breaks. Cheers, Greg On Jun 8, 2010, at 11:08 AM, Gene A wrote: On Tue, Jun 8, 2010 at 8:08 AM, Don Stewart d...@galois.com wrote:

[Haskell-cafe] Multidimensional generalization of the vector package

2010-05-27 Thread Gregory Crosswhite
Hey everyone, I have been thinking about how to generalize the vector package to multiple dimensions, and I'd like to share my ideas with you all in the hope of having people smarter than me share their thoughts on how it could be improved --- *especially* regarding how to make it efficient!

Re: [Haskell-cafe] Numerical Analysis

2010-05-17 Thread Gregory Crosswhite
of implementing an SVD algorithm might be useful for giving guidance on the kind of high-level operations that are needed in the library. Cheers, Greg On May 17, 2010, at 8:01 PM, Roman Leshchinskiy wrote: On 17/05/2010, at 05:17, Gregory Crosswhite wrote: As an aside, while

Re: [Haskell-cafe] Numerical Analysis

2010-05-16 Thread Gregory Crosswhite
On May 16, 2010, at 4:51 AM, Roman Leshchinskiy wrote: You are quite right that vector only supports nested arrays but not multidimensional ones. This is by design, however - the library's only goal is to provide efficient one-dimensional, Int-indexed arrays. I'm thinking about how to

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-09 Thread Gregory Crosswhite
On May 9, 2010, at 1:04 AM, wren ng thornton wrote: If you're structuring your code with that invariant, then why aren't you using the correct type? I do try to use the type system as much as possible to enforce constraints. However. it is not always so simple as making sure that a list

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Gregory Crosswhite
On May 7, 2010, at 4:54 PM, Limestraël wrote: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. As far as I can tell, its purpose is to essentially allow you to

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-05 Thread Gregory Crosswhite
On May 5, 2010, at 3:09 PM, Daniel Fischer wrote: Learning Lisp dialects is much harder (to a large part because of the parentheses, which makes them near impossible to parse). On the contrary, the whole point of parentheses is that it makes Lisp *easier* to parse... for computers. :-)

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread Gregory Crosswhite
to find all the edge cases of your code. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Tue, May 4, 2010 at 12:56, John Lato jwl...@gmail.com wrote: On Tue, May 4, 2010 at 5:31 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: Yes, but I think

[Haskell-cafe] 64-bit code on OSX?

2010-04-30 Thread Gregory Crosswhite
Hey everyone, Just out of curiosity, does anyone know the story on what is holding up the ability of GHC to generate 64-bit code on OSX? Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: GSoC: Improving Cabal's Test Support

2010-04-28 Thread Gregory Crosswhite
If the goal is continuous integration, perhaps it would be sufficient to require cabal test to return an error code of 0 if all tests succeed, and something else if any of them fail; it can additionally print whatever output it wants in either case. The continuous integration system would

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-28 Thread Gregory Crosswhite
On Apr 28, 2010, at 3:41 PM, Limestraël wrote: I think the problem with function serialization is that unlike languages which run over a virtual machine, bytecode generated by GHC is platform-specific (just as compilated C or C++) and therefore can run directly on top of the system, which

Re: [Haskell-cafe] Bulk Synchronous Parallel

2010-04-21 Thread Gregory Crosswhite
You know, I looked into Erlang, and while it looks intriguing it isn't great for my purposes because I want to be able to call Fortran routines to do the heavy number-crunching, and Erlang doesn't have a good standard FFI like Haskell. Also, I really don't want to use a dynamically typed

[Haskell-cafe] Bulk Synchronous Parallel

2010-04-19 Thread Gregory Crosswhite
Hey everyone, Has anyone done any work with bulk synchronous parallel computing in Haskell? The idea behind the model is that you divide your computation into a series of computation and communication phases, and it has recently occurred to me that this might be an ideal setup for

Re: [Haskell-cafe] Bulk Synchronous Parallel

2010-04-19 Thread Gregory Crosswhite
? Cheers, Greg On Apr 19, 2010, at 3:33 PM, Sebastian Sylvan wrote: On Mon, Apr 19, 2010 at 11:03 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: Hey everyone, Has anyone done any work with bulk synchronous parallel computing in Haskell? The idea behind the model is that you

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-08 Thread Gregory Crosswhite
That sounds like a reasonable modification; if you want, free to fork it at http://github.com/gcross/binary-protocol and push me your proposed changes. Cheers, Greg On Apr 8, 2010, at 9:12 AM, Yves Parès wrote: By the way, Gregory, concerning the package binary-protocol, I was wondering

Re: [Haskell-cafe] haskell gsoc proposal for richer numerical type classes and supporting algorithms

2010-04-08 Thread Gregory Crosswhite
On Apr 8, 2010, at 12:25 PM, Casey McCann wrote: Seriously, floating point so-called numbers don't even have reflexive equality! They don't? I am pretty sure that a floating point number is always equal to itself, with possibly a strange corner case for things like +/- 0 and NaN. Cheers,

Re: [Haskell-cafe] haskell gsoc proposal for richer numerical type classes and supporting algorithms

2010-04-08 Thread Gregory Crosswhite
On Apr 8, 2010, at 5:30 PM, Casey McCann wrote: On Thu, Apr 8, 2010 at 7:58 PM, wren ng thornton w...@freegeek.org wrote: Exactly. NaN /= NaN [...] Indeed. NaN means that equality is not reflexive for floats in general, only a subset of them. First of all, it isn't clear to me that NaN /=

Re: [Haskell-cafe] haskell gsoc proposal for richer numerical type classes and supporting algorithms

2010-04-08 Thread Gregory Crosswhite
On Apr 8, 2010, at 6:53 PM, Daniel Fischer wrote: Am Freitag 09 April 2010 02:51:23 schrieb Gregory Crosswhite: Yes, but 1/0 isn't a NaN: Prelude isNaN (1.0/0.0) False Prelude isNaN (0.0/0.0) True Prelude 1.0/0.0 Infinity Prelude 0.0/0.0 NaN Prelude (0.0/0.0) == (0.0/0.0) False

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-07 Thread Gregory Crosswhite
to remove it, but that just doesn't look good anymore. On 7 April 2010 14:19, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Mittwoch 07 April 2010 04:09:17 schrieb Gregory Crosswhite: While I think that (d) is a valid concern, it is also important not to let the perfect be the enemy of the good

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-07 Thread Gregory Crosswhite
Nicely done! On Apr 7, 2010, at 11:35 AM, Thomas Schilling wrote: http://i.imgur.com/kFqP3.png Didn't know about CSS's rgba to describe transparency. Very useful. On 7 April 2010 18:19, Gregory Crosswhite gcr...@phys.washington.edu wrote: Ooo, I really like this revision; it is a major

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-06 Thread Gregory Crosswhite
Yay, I'm glad to see someone else using my package. :-) Hmm, your program seems to work for me. I compiled and ran the Server (with ghc --make), then compiled and ran the Client, and then typed Operation 1.0 Mult 2.0 into the Client process, and the result it got was 2.0

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-06 Thread Gregory Crosswhite
, Yves Parès wrote: Weird... I use GHC 6.12.1, and I run Ubuntu 9.10 (32bits version). Would have I miss something? Like a flush or a close? Logically, I don't see where I would... Gregory Crosswhite-2 wrote: Yay, I'm glad to see someone else using my package. :-) Hmm, your program

Re: [Haskell-cafe] Re: GSoC: Improving Cabal's Test Support

2010-04-06 Thread Gregory Crosswhite
Rather that starting from scratch, you should strongly consider adapting something like test-framework to this task, as it already has done the heavy work of creating a way to combine tests from different frameworks into a single suite and includes such features as displaying a progress bar

Re: [Haskell-cafe] Re: GSoC: Improving Cabal's Test Support

2010-04-06 Thread Gregory Crosswhite
On Apr 6, 2010, at 4:40 PM, Thomas Tuegel wrote: Now, if you're telling me I'm going off in the wrong direction by proposing to integrate a test framework into Cabal itself, that's another story. Should I pare down my proposal to only include support for a proper 'Test' stanza in the

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-06 Thread Gregory Crosswhite
I concur that the latest version with the softer colors looks a lot nicer, and I approve of the overall design. I think that you should go back to using a change in the foreground color rather than the background color for the links in the main description, since at the moment it looks ugly.

<    1   2   3   >