Re: [Haskell-cafe] A wish for relaxed layout syntax

2007-03-28 Thread Greg Buchholz
Andrzej Jaworski wrote: Good direction. Perhaps you can also figure out how to replace the disturbing $ operator? Something out of Unicode? ≬⊳⌁⋆☕⚡‣‸‡⁏•△▴◆◇◊◬◢◮♘♣♲♪◖▻▿轢 Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] A wish for relaxed layout syntax

2007-03-28 Thread Greg Buchholz
David House wrote: I see this a lot. My personal preference is: mylist = [ foo, bar, baz, qux, quux, foo, bar, baz, qux ] Or, mylist = [foo, bar , baz, qux, quux, foo, bar, baz , qux] ___ Haskell-Cafe

Re: [Haskell-cafe] IO is not a monad (and seq, and in general _|_)

2007-01-23 Thread Greg Buchholz
http://www.cs.chalmers.se/~nad/publications/danielsson-lic.pdf Total Functional Programming http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] mapTuple (intersection types?)

2007-01-11 Thread Greg Buchholz
? mapTuple :: ((a - b) ^ (c - d)) - (a,c) - (b,d) http://www.cs.cmu.edu/~rwh/theses/pierce.pdf Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] why can't you surround (+) in backticks and have it be infix?

2007-01-08 Thread Greg Buchholz
` (qualified variable operator) conop -consym | `conid ` (constructor operator) qconop -gconsym | `qconid ` (qualified constructor operator) ...I've also thought it would be nice to be able to say things like... (foo `liftM2 (,)` bar) Greg Buchholz

Re: [Haskell-cafe] Re: Seeking advice on a style question

2006-12-29 Thread Greg Buchholz
Steve Schafer wrote: Here's the essence of the problem. If I have this: process1 x y = let u = foo x y; v = bar u; w = baz v in w I can easily rewrite it in point-free style: process1 = baz . bar . foo Not unless you have a much fancier version of

Re: [Haskell-cafe] Seeking advice on a style question

2006-12-29 Thread Greg Buchholz
Conal Elliott wrote: Warning: I haven't tried to type-check and may have made a clerical error. Since questionCategories isn't used, use fst eliminate another let. Then, for my personal preference, and just to mix things up, switch to where style: process item mediaKind mediaSize language

Re: [Haskell-cafe] multi parameter type classes for NP problems

2006-12-20 Thread Greg Buchholz
Joshua Ball wrote: Here is how I am trying to solve the problem, using multi-parameter type classes. class NPProblem inst cert where validates :: cert - inst - Bool certificates :: inst - [cert] decide :: inst - Bool decide i = any (\x - x `validates` i) $ certificates i

Re: [Haskell-cafe] type keeping rounding, typeable (and a difficulty)

2006-11-16 Thread Greg Buchholz
) = (roundDDec d c :+ roundDDec d b) roundDDec :: (RealFloat a) = Int - a - a roundDDec d a = a -- or somegthing Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] type keeping rounding, typeable (and a difficulty)

2006-11-15 Thread Greg Buchholz
isto wrote: ] I've been trying to compile the following function ] (rounding to a desired degree): ] ] roundDec :: (Num a, Typeable a) = Int - a - a ] roundDec d a = ] let t = show (typeOf a) ] in case t of ] Double - roundDDec d a ] Complex Double -

[Haskell-cafe] (twice head) (twice tail)

2006-11-11 Thread Greg Buchholz
a. (m a) - a) (m (m b)) b' ...I can't say I'm surprised, but I was wondering if anyone else has thoughts on how this limitation might be worked around. Curious, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] Re: An example of dependent types [was: Simple GADT parser for the eval example]

2006-11-01 Thread Greg Buchholz
[EMAIL PROTECTED] wrote: Greg Buchholz has posed an interesting problem of writing a typechecker. Given untyped terms of the form ...snip... We show the solution that uses no GADTs and no representation types. We retain however the eval function in the previous message that uses GADT. Our

Re: [Haskell-cafe] A type class puzzle

2006-10-31 Thread Greg Buchholz
= undefined ...you'll get an error message like... The equation(s) for `foo' have three arguments, but its type `[a] - a - r' has only two YMMV, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: Re: [Haskell-cafe] A type class puzzle

2006-10-31 Thread Greg Buchholz
Rearranging... Nicolas Frisby wrote: On 10/31/06, Greg Buchholz [EMAIL PROTECTED] wrote: ...That first article is the strangest. I couldn't reconcile the fact that if our type signature specifies two arguments, we can pattern match on three arguments in the function definition

Re: [Haskell-cafe] A type class puzzle

2006-10-31 Thread Greg Buchholz
- Int baz 0 = (+) baz 1 x = succ Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Simple GADT parser for the eval example

2006-10-31 Thread Greg Buchholz
that make any sense?). I'm curious if there could be a small change to the type system to make the fully general my_read possible, or if it suffers from an incurable defect. Thanks, Greg Buchholz {-# OPTIONS -fglasgow-exts #-} main = print test test :: Int

[Haskell-cafe] Simple GADT parser for the eval example

2006-10-30 Thread Greg Buchholz
) (EIsZ (ELit 42)))::Term Int) Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Rank N type tutorial?

2006-10-27 Thread Greg Buchholz
x Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Rank N type tutorial?

2006-10-27 Thread Greg Buchholz
In order for the first case to work as you expect, you'd need the type foo :: Integer - (a::Type, Show a, a) which is traditionally written foo :: Integer - (exists a. Show a = a) I thought exists was spelled forall in Haskell? Greg Buchholz

[Haskell-cafe] function types as instances of Num

2006-10-26 Thread Greg Buchholz
, a)), or somesuch. Any thoughts on how to get this to work? Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] function types as instances of Num

2006-10-26 Thread Greg Buchholz
of main and square to help nudge me in the right direction. (I'm using ghc-6.6) Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: (more) type level functions (type of decreasing list)

2006-10-23 Thread Greg Buchholz
[EMAIL PROTECTED] wrote: ] ] One way is to use existentials: ] data Seq1 a = forall b. (Pre a b, Show b) = Cons1 a (Seq1 b) | Nil1 ] ] which perhaps not entirely satisfactory because we have to specify all ] the needed classes in the definition of Seq1. Yes, that seems pretty

[Haskell-cafe] Re: type level functions (type of decreasing list)

2006-10-18 Thread Greg Buchholz
are interesting solutions! Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Type level functions (type of decreasing list)

2006-10-17 Thread Greg Buchholz
this to work. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Type level functions (type of decreasing list)

2006-10-17 Thread Greg Buchholz
Spencer Janssen wrote: ] Here's an attempt with GADTs: ] ] \begin{code} ] {-# OPTIONS_GHC -fglasgow-exts #-} ] data Succ a ] data Zero ] data Seq a b where ] Cons :: a - Seq a b - Seq a (Succ b) ] Nil :: Seq a Zero ] \end{code} ] ] Seems to work for me. Hmm. Maybe I'm missing

Re: [Haskell-cafe] The Q Programming Language can do symbolic manipulation -- Haskell?

2006-08-16 Thread Greg Buchholz
Casey Hawthorne wrote: The Q Programming Language can do the following: sqr X = X*X ==sqr 5 25 ==sqr (X+1) (X+1)*(X+1) Can Haskell do symbolic manipulation? Typeful symbolic differentiation of compiled functions

[Haskell-cafe] Re: [Haskell] Type-Level Naturals Like Prolog?

2006-07-13 Thread Greg Buchholz
Jared Warren wrote: Haskell's type checking language is a logical programming language. The canonical logical language is Prolog. Why can't Haskell (with extensions) do type-level Peano naturals in the same fashion? The code would be something like: Also of possible interest, _Fun with

Re: [Haskell-cafe] lists as instances of a class?

2006-07-10 Thread Greg Buchholz
4.3.2 of the Haskell Report (at least by my reading). Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Eager Parser Combinators [was: Functional programming for processing of largeraster images]

2006-06-22 Thread Greg Buchholz
the parser combinators from the Hutton and Meijer paper to perl... http://sleepingsquirrel.org/monads/parser/monad_parser.txt Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] Learning C after Haskell

2006-06-12 Thread Greg Buchholz
in a language like C. http://www.gnu.org/software/libc/manual/html_node/Allocation-Debugging.html http://perens.com/FreeSoftware/ElectricFence/ http://valgrind.org/ Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] Inferred type not most general?

2006-06-09 Thread Greg Buchholz
- d) - Twist a c - Twist b d data Twist a b = Nil | Cons a (Twist b a) deriving Show x = (Cons foo (Cons 1 (Cons bar (Cons 2 Nil tmap :: (a-b,c-d) - Twist a c - Twist b d tmap _ Nil = Nil tmap (f,g) (Cons x rest) = Cons (f x) (tmap (g,f) rest) Thanks, Greg Buchholz

Re: [Haskell-cafe] Type class hell

2006-06-08 Thread Greg Buchholz
Christophe Poucet wrote: The idea however is that MonoType is going to be used in a recursive way. For instance: newtype FMT = FMT MonoType FMT instance FMT where... Er, I'll ignore this part. And this definition will have to reside on recursive definitions. In the style of how

Re: [Haskell-cafe] Type class hell

2006-06-08 Thread Greg Buchholz
Christophe Poucet wrote: I'm not certain but I think this will still fail for exactly the piece that you ignored, which is the crux of the problem. -- You're not looking for this solution, right? import List type Var = String type Const = String data MonoType mt = TyVar Var

Re: [Haskell-cafe] Type class hell

2006-06-08 Thread Greg Buchholz
Brandon Moore wrote: I don't quite understand the problem, but maybe an example involving an explicit recursion operator will help. -- Maybe he's looking for something like... {-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fallow-undecidable-instances #-} import List type Var = String type

Re: [Haskell-cafe] Type class hell

2006-06-07 Thread Greg Buchholz
Christophe Poucet wrote: What I would like to do is combine HasVars and Type (mostly because in my framework the two concepts shouldn't be divided from a design perspective) into one type class to clean it up a bit. However I fail to see how I would implement toType and fromType for the given

Re: [Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-06-01 Thread Greg Buchholz
) :- not(isfuncwithhead(C,A)). isfuncwithhead(A=B,A). ...Now I just need to figure out how to represent not without cut. I'll take a look at what Oleg has done. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-06-01 Thread Greg Buchholz
Robert Dockins wrote: ] In the second instance, what you really want to say is instance c [a] ] c, only where c is not an application of (-). As I recall, there is ] a way to express such type equality/unequality using typeclasses, but ] I don't remember how to do it offhand. For those

[Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-05-31 Thread Greg Buchholz
extentsion and possibly the source code of the implementation? Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Newbie: Applying Unknown Number Arguments to A Partial Function

2006-05-30 Thread Greg Buchholz
Aditya Siram wrote: ] I am trying to write a function 'applyArguments' which takes a ] function and a list and recursively uses element each in the list as ] an argument to the function. I want to do this for any function taking ] any number of arguments. ] ] applyArgument f (arg) = f arg ]

Re: [Haskell-cafe] Newbie: Applying Unknown Number Arguments to A Partial Function

2006-05-19 Thread Greg Buchholz
Apply, then the types (a-b), b, and (a,c) are -- also a member, so keep going... instance Apply a b c = Apply (a-b) b (a,c) where app f (x,rest) = app (f x) rest g w x y z = w*x + y*z args = (1,(2,(3,(4,Nil main = print $ app g args Greg Buchholz

Re: [Haskell-cafe] Newbie: Applying Unknown Number Arguments to A Partial Function

2006-05-19 Thread Greg Buchholz
Greg Buchholz wrote: instance Apply a b c = Apply (a-b) b (a,c) where Whoops, instead of that, I think I meant... instance Apply (b-c) c d = Apply (a-b-c) (b-c) (a,d) where ...where we strip off one layer of types, because of the recursion. Of course, that still doesn't work though. Greg

Re: [Haskell-cafe] Partial Derivatives

2006-05-08 Thread Greg Buchholz
Gerhard Navratil wrote: I need a library that provides partial derivatives for functions. The solution I came up with is based on a datatype using reversed polish notation to store the function: I like Oleg Kiselyov's Typeful symbolic differentiation of compiled functions...

Re: [Haskell-cafe] show for functional types

2006-03-31 Thread Greg Buchholz
, but where did g come from? Is this is the internal definition of not? And does this loss of referential transparency contaminate the rest of the language, or is this superShow just an anomaly? Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] show for functional types

2006-03-31 Thread Greg Buchholz
in... *Main main (Var y)+(Const (2.0)) (Var y)+(Const (1.0))+(Const (1.0)) ...is this competely unrelated? Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] multiple computations, same input

2006-03-27 Thread Greg Buchholz
else 0, m+if g elem then elem else 0 ) ) (0,0) xs Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] multiple computations, same input

2006-03-27 Thread Greg Buchholz
FWIW, (not much), I asked a similar questions over on the Lambda-the-Ultimate blog a while back... http://lambda-the-ultimate.org/node/923 http://lambda-the-ultimate.org/node/485 ...Anyway, I can't help but think that there might be a happy medium between eager and lazy evaluation. Greg

Re: [Haskell-cafe] Eval of a syntax tree for reduction

2006-03-27 Thread Greg Buchholz
like the resulting Maybeified program, you can get the original functionality back by changing the type signature to use the Identity monad instead of Maybe. Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

[Haskell-cafe] Re: Deepest functor [was: fmap for lists of lists of lists of ...]

2006-03-15 Thread Greg Buchholz
. I guess I'll be brushing up on my typeclass-fu in order to figure out how all this works. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Deepest functor [was: fmap for lists of lists of lists of ...]

2006-03-15 Thread Greg Buchholz
. I guess I'll be brushing up on my typeclass-fu in order to figure out how all this works. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] fmap for lists of lists of lists of ...

2006-03-14 Thread Greg Buchholz
= map instance Funct a = Funct [a] where f_map f = map (f_map f) main = print $ fmap (+1) [[[1,2,3]]] ...but maybe it gets the idea across? Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] Statements spanning multiple lines?

2005-12-22 Thread Greg Buchholz
], a = b, b c, a*a + b*b == c*c ] ...See also... http://www.haskell.org/onlinereport/lexemes.html#lexemes-layout Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Statements spanning multiple lines?

2005-12-22 Thread Greg Buchholz
You might also like to try the slightly more efficient... pyth n = [(a,b,c) | a - [1..n], b - [a..n], c - [a+1..n], a*a + b*b == c*c ] Greg Buchholz ___ Haskell-Cafe

Re: [Haskell-cafe] Can't Haskell catch up with Clean's uniqueness typing?

2005-12-07 Thread Greg Buchholz
? Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Existentially-quantified constructors, Eq and Show

2005-12-07 Thread Greg Buchholz
| State a deriving (Show, Eq) ...Does it give better error messages at compile time or something? Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] Type classes and hFoldr from HList

2005-11-07 Thread Greg Buchholz
Ralf Lammel wrote: What you can do is define a dedicated *type code* for composition. comp = hFoldr (undefined::Comp) (id::Int - Int) test data Comp instance Apply Comp (x - y,y - z) (x - z) where apply _ (f,g) = g . f That does it! Thanks, Greg Buchholz

[Haskell-cafe] Type classes and hFoldr from HList

2005-11-06 Thread Greg Buchholz
) - (a - b) - a - c) ...into (a - c), or something else altogether. I figured someone might be able to help point me in the right direction. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

[Haskell-cafe] Working inside the fold

2005-10-06 Thread Greg Buchholz
interesting functions that could be defined? Is there a better way define these functions? Is there anything other than curiosity which would motivate someone to use these functions? FWIW, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Trapped by the Monads

2005-09-20 Thread Greg Buchholz
with the functions f and g besides just the boring old composition (like maybe skipping the execution of g if f fails, or allowing backtracking, or something more bizarre and clever). And what should we name this new super composition operator? = maybe? Ah... Greg Buchholz

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread Greg Buchholz
Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Practical introduction to monads

2005-08-02 Thread Greg Buchholz
and _Imperative functional programming_. Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Lists vs. Monads

2005-07-15 Thread Greg Buchholz
-legged animals with an exoskeleton. ...which tells us a lot more about the fundamental nature of insects. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] resolving missing class instances @ compile time

2005-05-12 Thread Greg Buchholz
? Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] resolving missing class instances @ compile time

2005-05-12 Thread Greg Buchholz
? Is it more convienient for compiler/specification writers this way? Is it just because that's the way its always been done? Curious, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] resolving missing class instances @ compile time

2005-05-12 Thread Greg Buchholz
checker after all). Confused, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] resolving missing class instances @ compile time

2005-05-12 Thread Greg Buchholz
? No. I've never written a Haskell compiler, but I'd say it sounds like it might be a tedious book-keeping problem though. Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Squashing space leaks

2005-05-05 Thread Greg Buchholz
. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Speed comparison?

2005-05-04 Thread Greg Buchholz
want to retarget ti so that Haskell is generated, or rewrite the generator in Haskell? (Or both?) Maybe not completely related, but you might find this paper interesting... http://lambda-the-ultimate.org/node/view/652 Greg Buchholz ___ Haskell

Re: [Haskell-cafe] How to speed things up

2005-04-28 Thread Greg Buchholz
Dmitry Vyal wrote: Hello everybody. I have a long list consisted of a small number (about a dozen) of elements repeating in random pattern. I know all the possible elements. I need to count number of occurences of each particular element and to do i quickly. For example quick_func

Re: [Haskell-cafe] How to speed things up

2005-04-28 Thread Greg Buchholz
Dmitry Vyal wrote: By the way, how to use Unboxed arrays and unsafeAccumArray Greg Buchholz mentioned? I can't find them in GHC 6.2 documentation. http://www.haskell.org/~simonmar/haddock-example/Data.Array.Base.html Greg Buchholz ___ Haskell

Re: [Haskell-cafe] Linux device drivers

2005-03-20 Thread Greg Buchholz
be interested in hOp: hOp is a micro-kernel based on the RTS of GHC. It is meant to enable people to experiment with writing device drivers in Haskell. http://www.macs.hw.ac.uk/~sebc/hOp/ or maybe House... http://www.cse.ogi.edu/~hallgren/House/ Greg Buchholz

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-11 Thread Greg Buchholz
Keean Schupke wrote: The things to notice are using types as instance labels, that constraints form horn clause compile time meta-programs (in a non-backtracking prolog style) and that multi-parameter classes with functional depandencies simulate some dependant types. I think I

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Greg Buchholz
Keean Schupke wrote: Haskell is not dependantly typed, so cannot deal with types that depend on values. Can anyone recommend a nice dependently typed language to play with? Cayenne, Epigram, other? Greg Buchholz ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Greg Buchholz
(which would imply it was possible to statically type). Well, it wasn't quite as direct as I had initially thought, but it looks like you've done it. Are there any papers/books out there which I could study to learn more about these (and other) tricks of the type system wizards? Thanks, Greg

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-08 Thread Greg Buchholz
, HTypeIndexed, GhcRecord, Record, HZip, HOccurs, HArray, HListPrelude, FakePrelude. Looks to me like a very similar error to the tuple case. Greg Buchholz --Joy combinators in Haskell {-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fallow-overlapping-instances #-} import MainGhcGeneric1 import

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Greg Buchholz
Daniel Fischer wrote: Am Freitag, 4. M?rz 2005 19:35 schrieb Greg Buchholz: So, can anyone direct me towards more information on exactly what an Occurs check is, or does anyone see an easy fix to my problems? If I remember correctly, an occurs check is checking whether a type variable

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Greg Buchholz
might work, only in better words. Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-04 Thread Greg Buchholz
check is, or does anyone see an easy fix to my problems? Thanks, Greg Buchholz P.S. The first thing you should note about the code below is the definition of the reverse composition operator (!), which I used to give the program a more Joy-like feel. (i.e. (!) f g = g.f) --Joy combinators

[Haskell-cafe] Parsec and type (IO t) error

2005-01-13 Thread Greg Buchholz
, sh) - parse_text shape_parse input I'm probably missing something silly. Any hint would be appreciated. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Parsec and type (IO t) error

2005-01-13 Thread Greg Buchholz
Mike Gunter wrote: I'd guess that let (cam, sh) = parse_text shape_parse input is what you want? (Completely untested ...) Yep. That did it. Thanks, Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Building GUIs for Haskell programs

2005-01-12 Thread Greg Buchholz
://zoo.cs.yale.edu/classes/cs490/03-04b/bartholomew.robinson/ ...although still a research project, it takes a more functional approach to GUI's. Greg Buchholz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Greg Buchholz
chokes without increasing the stack, while my copy of GHC 6.2.1 runs the program below quite fine, even without enabling optimizations. Greg Buchholz --Floating point PostScript version of Sierpinkski Carpet fillSquare x y s = putStr $ x1 ++ y2 ++ x1 ++ y1

Re: [Haskell-cafe] Non-technical Haskell question

2004-12-03 Thread Greg Buchholz
(camel) and _Perl_Cookbook_ (ram)? I suppose I should stop being lazy and contribute to the Haskell version of the PLEAC project... http://pleac.sourceforge.net/ Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org

Re: [Haskell-cafe] Re: Processing of large files

2004-11-01 Thread Greg Buchholz
are superior: in efficiency; in ease of programming; in more predictable resource utilization and avoidance of resource leaks. We present a design of the overall optimal collection traversal interface, which is based on a left-fold-like combinator with premature termination. Greg Buchholz

Re: [Haskell-cafe] Re: OCaml list sees abysmal Language Shootout results

2004-10-11 Thread Greg Buchholz
Moments Process Instantiation Reverse A File Ring of Messages Count Lines/Words/Chars Word Frequency Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Purely Functional Data Structures [was: OCaml list sees abysmal...]

2004-10-10 Thread Greg Buchholz
Robert Dockins wrote: BTW can you give some references to these known techniques? See also, Purely Functional Data Structures by Chris Okasaki for functional implementations of queues, dequeues, etc. www-2.cs.cmu.edu/~rwh/theses/okasaki.pdf Greg Buchholz

[Haskell-cafe] Algebraic Collections [was: OCaml list sees abysmal...]

2004-10-08 Thread Greg Buchholz
-ilmenau.de/~robertw/dessy/fun/democratic/ Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] OCaml list sees abysmal Language Shootout results

2004-10-05 Thread Greg Buchholz
(concat $ replicate (read n) keys) putStrLn $ unwords $ map show [get hash1 foo_1, get hash1 foo_, get res foo_1, get res foo_] Thanks, Greg Buchholz

Re: [Haskell-cafe] OCaml list sees abysmal Language Shootout results]

2004-09-30 Thread Greg Buchholz
bytes per MUT second Productivity 57.7% of total user, 51.7% of total elapsed Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] OCaml list sees abysmal Language Shootout results

2004-09-30 Thread Greg Buchholz
of the test and gnu/wc) perl-5.8.4 0.535s gcc-3.4.2 0.102s gnu/wc 0.435s Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] OCaml list sees abysmal Language Shootout results

2004-09-30 Thread Greg Buchholz
time 74.2% (70.8% elapsed) Alloc rate388,122,622 bytes per MUT second Productivity 25.8% of total user, 25.1% of total elapsed Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] OCaml list sees abysmal Language Shootout results

2004-09-30 Thread Greg Buchholz
Haskell style application. If someone (not haskeller) looks at the implementation it should be very obvious and clear. It might also be nice if the code would run under the other haskell compliers like Hugs and nhc98 right out-of-the-box. Greg Buchholz

[Haskell-cafe] Favorite/recommended math books

2004-01-28 Thread Greg Buchholz
_Foundations of Mathematical Logic_? Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: newbie question regarding type declarations

2003-11-02 Thread Greg Buchholz
(=) and the small arrow (-). This is the most general type you could make for this particular function and allows you to mix amd match arguments like... square(3, 4) square(3.14, 4) square(2.718, 6.022) etc. Greg Buchholz ___ Haskell-Cafe mailing list [EMAIL PROTECTED