Re: [Haskell-cafe] US Patent for the idea of using Haskell to implement UAX #9

2010-04-17 Thread Brian Hulley
Daniel Fischer wrote: Am Freitag 16 April 2010 20:50:25 schrieb Brian Hulley: revealed a link to a US Patent (7120900) for the idea of implementing the Unicode Bidirectional Algorithm (UAX #9 http://www.unicode.org/reports/tr9) in Haskell, making use, as far as I can tell, of nothing more than

Re: [Haskell-cafe] Re: US Patent for the idea ...

2010-04-17 Thread Brian Hulley
jerzy.karczmarc...@info.unicaen.fr wrote: Brian Hulley reports a search similar to : haskell unicode bidirectional Comment irrelevant to Haskell, sorry. Everybody does his/her various jobs. But I lost all respect due to people who work in the US Patent Office, when I saw the patent

Re: [Haskell-cafe] Re: US Patent for the idea ...

2010-04-17 Thread Brian Hulley
Murray Gross wrote: On Sat, 17 Apr 2010, Brian Hulley wrote: see the patent 6,368,227. The search site is here: http://patft.uspto.gov/netahtml/PTO/srchnum.htm Best regards. Jerzy Karczmarczuk ... It's really almost not fair to cite that particular patent, since, if I recall the story

[Haskell-cafe] US Patent for the idea of using Haskell to implement UAX #9

2010-04-16 Thread Brian Hulley
Hi everyone, It's been a long time since I last posted to this list since I'm currently working on something that is not directly Haskell-related, but it still relates to functional programming in general. Anyway imagine my surprise when an innocent search for some keywords (I can't remember

Re: [Haskell-cafe] Looking for a more functional way to do this

2008-08-06 Thread Brian Hulley
Jefferson Heard wrote: Adrian, my understanding is that it's not that simple, because I need to preserve the state between calls to GLUT's callbacks, which all return IO (). 2008/8/6 Adrian Neumann [EMAIL PROTECTED]: There is the State Monad... data ProgramState = ProgramState {

Re: [Haskell-cafe] Capitalization and associated type families

2008-08-05 Thread Brian Hulley
Jonathan Cast wrote: It's weird. ML-derived languages are functional languages at the value level (and have regular lambda-bound variables in consequence), but are logical languages at the type level (and have logical variables in consequence). So ordinary lambda-bound variables, like in

Re: [Haskell-cafe] Capitalization and associated type families

2008-08-05 Thread Brian Hulley
Tillmann Rendel wrote: Brian Hulley wrote: class Foo a where f :: a - b - (a, b) Here there is no capitalization distinction in the type of (f) but the implementation can still insert the forall b. since (a) is already in scope. Therefore similarly, if type constructors like

[Haskell-cafe] Capitalization and associated type families

2008-08-04 Thread Brian Hulley
Hi, I'm familiar with the capitalization rules for identifiers in Haskell and know that they are very useful and practical e.g. by allowing variables to be distinguished from constants in patterns etc. However I'm trying to understand on a much deeper level whether or not they can really be

Re: [Haskell-cafe] Capitalization and associated type families

2008-08-04 Thread Brian Hulley
Jonathan Cast wrote: On Mon, 2008-08-04 at 19:51 +0100, Brian Hulley wrote: For example, why is there any distinction between a type variable and a type constant? forall a b. (a - b) - List a - List b Now this begs the question: why does List need to start with a capital? (supposing

Re: [Haskell-cafe] Dynamic choice of reverse implementation

2007-09-28 Thread Brian Hulley
Krzysztof Kościuszkiewicz wrote: Fellow Haskellers, I wanted to experiment a bit with lists and sequences (as in Data.List and Data.Sequence), and I got stuck. I wanted to dynamically select processing function depending on cmdline argument: main = do args - getArgs let reversor =

Re: [Haskell-cafe] Dynamic choice of reverse implementation

2007-09-28 Thread Brian Hulley
Brian Hulley wrote: Krzysztof Kościuszkiewicz wrote: So the type of mapM_ used in the code is (Foldable t, Monad m) = (a - m b) - t a - m () I'd like to keep the generic Foldable t there when m is specialized to IO. I thought this would allow type of reversor to be specialized to (Foldable f

Re: [Haskell-cafe] Dynamic choice of reverse implementation

2007-09-28 Thread Brian Hulley
Krzysztof Kościuszkiewicz wrote: So the type of mapM_ used in the code is (Foldable t, Monad m) = (a - m b) - t a - m () I'd like to keep the generic Foldable t there when m is specialized to IO. I thought this would allow type of reversor to be specialized to (Foldable f) = [String] - f String

Re: [Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-27 Thread Brian Hulley
Sam Hughes wrote: Brian Hulley wrote: ... For example, with the prefix definition of a function with multiple clauses, the function name at the start of each clause is already lined up since it must appear at the margin of the current layout block ... Or you could have everything

[Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-25 Thread Brian Hulley
Hi, I'm in the process of designing a little language inspired by Haskell but imperative, and have hit an issue regarding infix syntax which may be of interest also to anyone thinking about future revisions of Haskell or the problem of consistent parameter order in libraries. I'm wondering

Re: [Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-25 Thread Brian Hulley
Brian Hulley wrote: I'm wondering if anyone can shed light on the reason why x # y gets desugared to (#) x y and not (#) y x Can anyone think of an example where the current desugaring of infix arguments gives the correct order when the function is used in a postfix application

Re: [Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-25 Thread Brian Hulley
Jonathan Cast wrote: On Tue, 2007-09-25 at 19:18 +0100, Brian Hulley wrote: Brian Hulley wrote: I'm wondering if anyone can shed light on the reason why x # y gets desugared to (#) x y and not (#) y x Of course, this is all a consequence of the well-known failure

Re: [Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-25 Thread Brian Hulley
Ryan Ingram wrote: My comments inlined below... On 9/25/07, Brian Hulley [EMAIL PROTECTED] wrote: let shiftLeftByThree = shiftL' 3 in map shiftLeftByThree [10, 78, 99, 102] let shiftLeftByThree = (`shiftL` 3) in ... Aha! but this is using section syntax which

Re: [Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-25 Thread Brian Hulley
Dan Piponi wrote: On 9/25/07, Brian Hulley [EMAIL PROTECTED] wrote: ..I seem to dimly recall that there is a natural language somewhere that also uses it but I can't remember which one. Every permutation of [S,V,O] appears in 'nature': http://en.wikipedia.org/wiki/Word_order. Thanks

[Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brian Hulley
Hi, On http://hackage.haskell.org/trac/haskell-prime/wiki/LambdaCase the proposed syntax for lambda case is: case of alts but this has a really bad downside for interactive editors: it doesn't allow one to distinguish between an incomplete construct and a completed construct thus

Re: [Haskell-cafe] Syntax for lambda case proposal could be \of

2007-08-15 Thread Brian Hulley
Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we stipulate that unlike a case

Re: [Haskell-cafe] Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-13 Thread Brian Hulley
Brian Hulley wrote: apfelmus wrote: Brian Hulley schrieb: main = do buffer - createBuffer edit1 - createEdit buffer edit2 - createEdit buffer splitter - createSplitter (wrapWidget edit1) (wrapWidget edit2) runMessageLoopWith splitter

Re: [Haskell-cafe] Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-12 Thread Brian Hulley
apfelmus wrote: Brian Hulley schrieb: main = do buffer - createBuffer edit1 - createEdit buffer edit2 - createEdit buffer splitter - createSplitter (wrapWidget edit1) (wrapWidget edit2) runMessageLoopWith splitter ... Thus the ability

[Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Brian Hulley
apfelmus wrote: However, most genuinely imperative things are often just a building block for a higher level functional model. The ByteString library is a good example: the interface is purely functional, the internals are explicit memory control. It's a bad idea to let the internal memory

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Brian Hulley
Martin Percossi wrote: Brian Hulley wrote: hidden away in the definition of their API function to create a label, is a call to (ref 0) ;-) The equivalent implementation in Haskell would completely destroy all hope of using this in a pure context and force all use of the API into the IO

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Brian Hulley
Hugh Perkins wrote: On 8/8/07, *Brian Hulley* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: In contrast, all the pure functional GUIs that I've seen... In defense of Haskell (wow!), note that imperative languages are not without problems in GUIs. In a multithreaded environment

Re: [Haskell-cafe] a regressive view of support for imperative programming in Haskell

2007-08-08 Thread Brian Hulley
Paul Hudak wrote: All of the recent talk of support for imperative programming in Haskell makes me really nervous ... if we give imperative programmers the tools to do all the things they are used to doing in C++, then we will be depriving them of the joys of programming in the

Re: [Haskell-cafe] Newbie question: multi-methods in Haskell

2007-08-06 Thread Brian Hulley
peterv wrote: In de book Modern C++ design, Andrei Alexandrescu writes that Haskell supports “multi-methods” Using multi-methods, I could write (in pseudo code) collide (Asteroid, Planet) = an asteroid hit a planet collide (Asteroid, Earth) = the end of the dinos ... collide (Planet,

Re: [Haskell-cafe] Newbie question: multi-methods in Haskell

2007-08-06 Thread Brian Hulley
Dan Weston wrote: Remember that type classes do not provide object-oriented functionality. The dispatch is static, not dynamic. Although OOP can be simulated in Haskell, it is not a natural idiom. If you need dynamic dispatch (including multiple dispatch), you may want to reconsider your

Re: [Haskell-cafe] Newbie question: multi-methods in Haskell

2007-08-06 Thread Brian Hulley
peterv wrote: This is very nice, but it does not really solve the original problem. To get Haskell to choose the best fit it's necessary to encode the location of each element in the hierarchy, so that elements deeper in the hierarchy are more instantiated than those at the top. Then

[Haskell-cafe] Re: monad subexpressions

2007-08-05 Thread Brian Hulley
On Fri Aug 3 06:06:31 EDT Neil Mitchell wrote: What are the semantics of do b f (- a) where does the evaluation of a get lifted to? I suggest the execution of (a) should be done immediately before the action obtained by applying the monadic function whose argument it is part of:

[Haskell-cafe] Using Haskell to investigate ML's value restriction

2007-07-18 Thread Brian Hulley
Hi, Ii is interesting that in ML, the presence of mutable ref cells and parametric polymorphism requires the whole language to be dominated by a value restriction [1] to ensure that the type system remains sound, whereas in Haskell, because IORef's can only be created (and used) in the IO

[Haskell-cafe] Proposal for allowing more use of layout to avoid parentheses and commas

2007-02-03 Thread Brian Hulley
Hi, Following a recent thread on the Haskell' mailing list about the nusiance of having to deal with commas in tuples (when cutting and pasting things to re-order the elements there's always a pesky comma left over in the wrong place), I've written up a proposal for a very simple syntax tweak

Re: [Haskell-cafe] Re: Channel9 Interview: Software Composability andtheFu ture of Languages

2007-01-31 Thread Brian Hulley
Donald Bruce Stewart wrote: magnus: All I'm trying to say is that imperative thinking is so common outside of CS/math and we learn it so early on in life that we probably can consider it the natural thinking way. foldl (\water dish - wash water dish) soapywater dishes :: [Dishes] ^^ type

Re: [Haskell-cafe] Trouble understanding records and existential types

2007-01-25 Thread Brian Hulley
On Thursday, January 25, 2007 7:08 AM, John Ky wrote: On 1/25/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: I'm probably missing something, but: (a) Why not: data ANode = Branch { name :: String, description :: String, children :: [AnyNode] }

Re: [Haskell-cafe] Trouble understanding records and existential types

2007-01-25 Thread Brian Hulley
Chris Kuklewicz wrote: This is how I would write getLeaves, based on your GADT: data IsLeaf data IsBranch newtype Node = Node { getNode :: (forall c. ANode c) } data ANode :: * - * where Branch :: String - String - (ANode a,ANode b) - [Node] - ANode IsBranch Leaf :: String - String

Re: [Haskell-cafe] basic field questions

2007-01-24 Thread Brian Hulley
jamin1001 wrote: Hi, I am new at Haskell and have some basic questions. So then how should this be done? What if I want to do something like data Chair = Chair {pos:: Int, color :: Int} data Table = Table {pos:: Int, color :: Int} Unfortunately you have to think up different names for all

Re: [Haskell-cafe] IO is not a monad

2007-01-23 Thread Brian Hulley
Yitzchak Gale wrote: I wrote: Prelude let f .! g = ((.) $! f) $! g Prelude let f = undefined :: Int - IO Int Prelude f `seq` 42 *** Exception: Prelude.undefined Prelude ((= f) . return) `seq` 42 42 Prelude ((= f) .! return) `seq` 42 42 Duncan Coutts wrote: Perhaps I'm missing something but I

Re: [Haskell-cafe] IO is not a monad

2007-01-23 Thread Brian Hulley
Brian Hulley wrote: Yitzchak Gale wrote: I wrote: Prelude let f = undefined :: Int - IO Int Prelude f `seq` 42 *** Exception: Prelude.undefined Prelude ((= f) . return) `seq` 42 42 The monad laws say that (= f) . return must be identical to f. I thought it was: return x = f = f x so

Re: [Haskell-cafe] IO is not a monad

2007-01-23 Thread Brian Hulley
Brian Hulley wrote: Brian Hulley wrote: Yitzchak Gale wrote: I wrote: Prelude let f = undefined :: Int - IO Int Prelude f `seq` 42 *** Exception: Prelude.undefined Prelude ((= f) . return) `seq` 42 42 The monad laws say that (= f) . return must be identical to f. I thought

Re: [Haskell-cafe] Re: Article review: Category Theory

2007-01-19 Thread Brian Hulley
Lennart Augustsson wrote: On Jan 19, 2007, at 08:05 , [EMAIL PROTECTED] wrote: Thus, Hask is not a category, at least not as defined in the article. The problem is that (either) morphisms or the morphism composition ('.') are not internalized correctly in Haskell. And this is why some of

[Haskell-cafe] seq (was: Article review: Category Theory)

2007-01-19 Thread Brian Hulley
Neil Mitchell wrote: Hi Brian, Is there any solution that would allow excess laziness to be removed from a Haskell program such that Hask would be a category? class Seq a where seq :: a - b - b Then you have a different seq based on the types, and it doesn't go wrong. You would probably

Re: [Haskell-cafe] Re: Article review: Category Theory

2007-01-18 Thread Brian Hulley
Johan Gršnqvist wrote: Ulf Norell skrev: On Jan 16, 2007, at 7:22 PM, David House wrote: In the section on the category laws you say that the identity morphism should satisfy f . idA = idB . f This is not strong enough. You need f . idA = f = idB . f (I do not know category theory,

Re: [Haskell-cafe] Article review: Category Theory

2007-01-17 Thread Brian Hulley
David House wrote: http://en.wikibooks.org/wiki/Haskell/Category_theory I'd love comments from newcomers and experts alike regarding my approach, the content, improvements and so on. Of course, it's on the wikibook, so if you have anything to add (that's not _too_ substantial otherwise I'd

Re: [Haskell-cafe] Article review: Category Theory

2007-01-17 Thread Brian Hulley
Brian Hulley wrote: David House wrote: http://en.wikibooks.org/wiki/Haskell/Category_theory But in the second exercise in the intro it's clear that function composition is not associative. Apologies. I got totally confused with the way function composition is back to front etc. I still

Re: [Haskell-cafe] Article review: Category Theory

2007-01-17 Thread Brian Hulley
Yitzchak Gale wrote: David House wrote: I've added a bit more explanation, so it may now be palatable. It is quite a hard exercise, though, perhaps it shouldn't come so early on. In my opinion, it is now much more clear. And it is a very instructive example. If people still find it too hard,

Re: [Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-15 Thread Brian Hulley
Meng Wang wrote: Hi Brian, Thank you for starting the thread. We (Martin Sulzmann and me) proposed a type class extension which allows modular extension of superclasses (a complement of subclass extension). The idea has been shown to be particularly useful in (but not limited to) encodings of

Re: [Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-09 Thread Brian Hulley
Simon Peyton-Jones wrote: One of the great things about John's class-alias proposal is that John worked out a lot of details and captured them in a web page, rather than it getting buried in an email thread. If you have ideas to refine his proposal, it'd be good to see if, with him, you can

Re: [Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-09 Thread Brian Hulley
Brian Hulley wrote: Simon Peyton-Jones wrote: One of the great things about John's class-alias proposal is that John worked out a lot of details and captured them in a web page, rather than it getting buried in an email thread. If you have ideas to refine his proposal, it'd be good to see

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

2007-01-08 Thread Brian Hulley
[EMAIL PROTECTED] wrote: David House wrote: You can fake this: (-!) = ($) (!-) = flip ($) foo -! liftM2 (,) !- bar Was anyone in that brainstorm thinking of Chung-chieh Shan's -: and :- (http://www.haskell.org/pipermail/haskell-cafe/2002-July/003215.html) or was the similarity just a

[Haskell-cafe] Why does the wiki search facility not work properly?

2007-01-07 Thread Brian Hulley
Hi, There is a page on the Haskell Wiki titled Talk:SantaClausProblem subtitled Beautiful concurrency. However typing any of the following into the search box *doesn't* lead to the page: Santa talk:santaclausproblem beautiful beautiful concurrency Talk:Santa In fact to get the

Re: [Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-06 Thread Brian Hulley
Bulat Ziganshin wrote: Hello Brian, Thursday, January 4, 2007, 10:00:05 PM, you wrote: deeper, the programmer is burdened more and more by the need to cut-and-paste method definitions between instances because Haskell doesn't allow a superclass (or ancestor class) method default to be

Re: [Haskell-cafe] Stupid newbie question

2007-01-06 Thread Brian Hulley
Brian Hurt wrote: nth 0 (x:xs) = Some x nth i (x:xs) = if i 0 then Empty else nth (i-1) xs nth i [] = Empty [blows stack on large i] As other people have pointed out, this is due to laziness. I'd write it like: nth 0 (x:_) = Some x nth i (_:xs) = of i 0 then Empty else (nth $! i-1)

Re: [Haskell-cafe] Stupid newbie question

2007-01-06 Thread Brian Hulley
Brian Hulley wrote: Brian Hurt wrote: nth 0 (x:xs) = Some x nth i (x:xs) = if i 0 then Empty else nth (i-1) xs nth i [] = Empty [blows stack on large i] As other people have pointed out, this is due to laziness. I'd write it like: nth 0 (x:_) = Some x nth i (_:xs) = of i 0 then Empty

Re: [Haskell-cafe] Stupid newbie question

2007-01-06 Thread Brian Hulley
Brian Hulley wrote: Brian Hulley wrote: Brian Hurt wrote: nth 0 (x:xs) = Some x nth i (x:xs) = if i 0 then Empty else nth (i-1) xs nth i [] = Empty [blows stack on large i] As other people have pointed out, this is due to laziness. I'd write it like: nth 0 (x:_) = Some x nth i (_:xs

[Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-04 Thread Brian Hulley
Hi, Looking at some of the ideas in http://www.haskell.org/haskellwiki/The_Other_Prelude , it struck me that the class system at the moment suffers from the problem that as hierarchies get deeper, the programmer is burdened more and more by the need to cut-and-paste method definitions between

Re: [Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-04 Thread Brian Hulley
Roberto Zunino wrote: Brian Hulley wrote: because Haskell doesn't allow a superclass (or ancestor class) method default to be redefined in a subclass. How one would write instances? Using your Monad class, does instance Monad F where return = ... (=) = ... automatically define

Re: [Haskell-cafe] Composing functions with runST

2007-01-01 Thread Brian Hulley
Yitzchak Gale wrote: Can anyone explain the following behavior (GHCi 6.6): Prelude Control.Monad.ST runST (return 42) 42 Prelude Control.Monad.ST (runST . return) 42 interactive:1:9: Couldn't match expected type `forall s. ST s a' against inferred type `m a1' In the second

Re: [Haskell-cafe] Idiomatic Haskell equivalent of keyword argumentsto functions

2006-12-29 Thread Brian Hulley
Paul Moore wrote: I'm thinking around the design of a couple of things, and am hitting an issue which I know how I would solve in Python, but I'm not sure what a good idiomatic Haskell approach would be. The problem is that I am trying to write a function which takes a rather large number of

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

2006-12-27 Thread Brian Hulley
Steve Schafer wrote: In my text/graphics formatting work, I find myself doing a lot of pipeline processing, where a data structure will undergo a number of step-by-step transformations from input to output. For example, I have a function that looks like this (the names have been changed to

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Brian Hulley
Lennart Augustsson wrote: On Dec 21, 2006, at 15:53 , Neil Mitchell wrote: Hi there are really no choices for real development. many libraries, language extensions and techniques are for ghc only I develop everything in Hugs, including the Yhc compiler itself. Hugs is great. There are lots

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Brian Hulley
Neil Mitchell wrote: Hi In other words, what on earth is good about gluing oneself to Haskell98? Life's moved on... If you stick to Haskell 98 you can: * Convert your code to Clean (Hacle) * Debug it (Hat) * Run it in your browser (ycr2js) * Document it (Haddock) * Make a cross platform

Re: Stronger static types, was Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Brian Hulley
Jacques Carette wrote: Yes, dependent types have a lot to do with all this. And I am an eager lurker of all this Epigram. Would it be possible to augment Haskell's type system so that it was the same as that used in Epigram? Epigram itself uses a novel 2d layout and a novel way of writing

Re: [Haskell-cafe] Shrinking the Prelude: The categorical approach

2006-12-20 Thread Brian Hulley
Imam Tashdid ul Alam wrote: hi guys, I was just wondering if anyone is interested is a quasi-project of rewriting the Prelude (only shrinking it as measured by the total number of names imported, read along...) the idea is (just to be substantially different in approach) to develop an alternate

Re: [Haskell-cafe] Haskell Side Effect

2006-12-20 Thread Brian Hulley
Ashley Yakeley wrote: Since learning Haskell, I can now count in Spanish! See: one in Spanish, two in Spanish, three in Spanish, four in Spanish.. Is there a solution ie some concept C such that C Haskell C Spanish, somewhere? Thanks, Brian. -- http://www.metamilk.com

Re: [Haskell-cafe] Class annotation on datatype ineffective in function

2006-12-19 Thread Brian Hulley
Reto Kramer wrote: The code below does not compile unless the bar function is annotated with a suitable constraint on the class of the formal parameter. class (C a) data (C foo) = XY foo = X foo | Y foo bar :: a - XY a bar aFoo = X aFoo As suggested, this works: bar :: (C a) = a - XY a

Re: [Haskell-cafe] Showing the 1 element tuple

2006-12-19 Thread Brian Hulley
Neil Mitchell wrote: Hi, A weird question, what does the 1 element tuple look like? () -- 0 element tuple (,) a b -- 2 element tuple (,,) a b c -- 3 element tuple () a - meaningless (a) - a in brackets GHC has the 1 element unboxed tuple, (# a #), and all the other sizes unboxed as well, but

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Phooey -- a Functional UI library for Haskell

2006-12-12 Thread Brian Hulley
Brian Hulley wrote: Conal Elliott wrote: GUIs are usually programmed in an unnatural style, in that ... Also, suppose you have a gui consisting of an edit widget such that when the user types something it gets lexed, parsed, and fontified as a Haskell program, ie from the user's point

Re: [Haskell-cafe] Re: Aim Of Haskell

2006-12-12 Thread Brian Hulley
Kirsten Chevalier wrote: since it's not as if anyone programs in Pascal anymore. Yet I'm sure most people who did a computer science degree some decades ago remember the old joke about passing things by name or value for what it's Wirth... :-) Brian. -- http://www.metamilk.com

Re: [Haskell-cafe] Functional GUI combinators for arbitrary graphs of components?

2006-12-03 Thread Brian Hulley
Taral wrote: On 12/1/06, Brian Hulley [EMAIL PROTECTED] wrote: This problem is so general (ie converting a cyclic graph into an expression tree such that each node appears no more than once) that I'm sure someone somewhere must already have determined whether or not there can be a solution

Re: [Haskell-cafe] Functional GUI combinators for arbitrary graphs ofcomponents?

2006-12-03 Thread Brian Hulley
Paul Hudak wrote: Brian Hulley wrote: Anyway to get to my point, though all this sounds great, I'm wondering how to construct an arbitrary graph of Fudgets just from a fixed set of combinators, such that each Fudget (node in the graph) is only mentioned once in the expression. To simplify

Re: [Haskell-cafe] Strange type behavior in GHCi 6.4.2

2006-12-02 Thread Brian Hulley
Grady Lemoine wrote: f x = x^3 f' = snd . (evalDeriv f) When I load this in GHCi, I get: *Main :t f f :: (Num a) = a - a *Main :t snd . (evalDeriv f) snd . (evalDeriv f) :: (Num a, Num (Dual a)) = a - a *Main :t f' f' :: Integer - Integer Why is the type of f' Integer - Integer,

[Haskell-cafe] Functional GUI combinators for arbitrary graphs of components?

2006-12-01 Thread Brian Hulley
Hi, I've been looking at the Fudgets research (http://www.cs.chalmers.se/ComputingScience/Research/Functional/Fudgets/ ) as an example of a purely functional gui. Afaiu a brief summary is that a Fudget can represent a GUI widget or some other object, which can have some internal state, and

Re: [Haskell-cafe] Functional GUI combinators for arbitrary graphs ofcomponents?

2006-12-01 Thread Brian Hulley
Brian Hulley wrote: Anyway to get to my point, though all this sounds great, I'm wondering how to construct an arbitrary graph of Fudgets just from a fixed set of combinators, such that each Fudget (node in the graph) is only mentioned once in the expression. To simplify the question, assume we

Re: [Haskell-cafe] [Haskell] Defining Cg, HLSL style vectors in Haskell

2006-11-28 Thread Brian Hulley
Slavomir Kaslev wrote: I have to define a couple of float2, float3, float4 Cg, HLSL style vectors in Haskell. At first I was tempted to make them instances of Num, Floating, RealFrac, etc. but some of the functions defined in those classes have no sense for vectors. I'd suggest that this

[Haskell-cafe] Why instances can't be hidden (was: non-total operator precedence order)

2006-11-11 Thread Brian Hulley
Benjamin Franksen wrote: Henning Thielemann wrote: On Fri, 10 Nov 2006, Benjamin Franksen wrote: Although one could view this as a bug in the offending module it makes me somewhat uneasy that one additional import can have such a drastic effect on the code in a module /even if you don't use

Re: [Haskell-cafe] Automatic fixity allocation for symbolic operators

2006-10-15 Thread Brian Hulley
Jim Apple wrote: On 10/14/06, Brian Hulley [EMAIL PROTECTED] wrote: User defined fixities are an enormous problem for an interactive editor This is the second or third time you've proposed a language change based on the editor you're writing. I don't think this is a fruitful avenue

[Haskell-cafe] Automatic fixity allocation for symbolic operators

2006-10-14 Thread Brian Hulley
Hi - I'm wondering if it is possible to construct a methodical procedure to assign a fixity to symbolic operators so that we could get rid of the need for user defined fixites. User defined fixities are an enormous problem for an interactive editor, because it is not possible to construct a

Re: [Haskell-cafe] A type in search of a name...

2006-10-13 Thread Brian Hulley
Albert Lai wrote: Brian Hulley [EMAIL PROTECTED] writes: You'll never believe it but I've been struggling last night and all of today to try and think up a name for the following type and I'm still nowhere near a solution: data ??? = VarId | VarSym | ConId | ConSym Perhaps Atom

Re: [Haskell-cafe] Vertical tabs in source code and other obscure chars

2006-10-11 Thread Brian Hulley
Brian Hulley wrote: Hi, In the Haskell98 report at http://haskell.org/onlinereport/lexemes.html section 2.2 has the rule: whitechar - newline | vertab | space | tab | uniWhite Does anyone know what a vertical tab is supposed to do? Is there any reason to allow them as whitespace? (Does

[Haskell-cafe] A type in search of a name...

2006-10-10 Thread Brian Hulley
Hi, You'll never believe it but I've been struggling last night and all of today to try and think up a name for the following type and I'm still nowhere near a solution: data ??? = VarId | VarSym | ConId | ConSym this is part of a type to describe Haskell lexemes: data Token = TName

[Haskell-cafe] Vertical tabs in source code and other obscure chars

2006-10-09 Thread Brian Hulley
Hi, In the Haskell98 report at http://haskell.org/onlinereport/lexemes.html section 2.2 has the rule: whitechar - newline | vertab | space | tab | uniWhite Does anyone know what a vertical tab is supposed to do? Is there any reason to allow them as whitespace? (Does anyone in the universe

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-09 Thread Brian Hulley
Lennart Augustsson wrote: I think your first try looks good. [snip] ... addPoly1 p1@(p1h@(Nom p1c p1d):p1t) p2@(p2h@(Nom p2c p2d):p2t) | p1d == p2d = Nom (p1c + p2c) p1d : addPoly1 p1t p2t | p1d p2d = p1h : addPoly1 p1t p2 | p1d p2d = p2h : addPoly1 p1 p2t ... The last comparison

Re: [Haskell-cafe] Either as a Monad instance

2006-10-03 Thread Brian Hulley
Ross Paterson wrote: On Tue, Oct 03, 2006 at 07:52:54AM -0400, Lennart Augustsson wrote: Yes, having fail in the Monad is a horrible wart. (As far as I know, it's there for the translation of pattern match failure in do-expressions.) I think it would be much less of a wart if the signature

Re: [Haskell-cafe] smallest double eps

2006-09-30 Thread Brian Hulley
Lennart Augustsson wrote: Hang on, hang on, now I'm getting confused. First you asked for the smallest (positive) x such that 1+x /= x which is around x=4.5e15. 1 + 0 /= 0 0 is smaller than 4.5e15 So I don't understand this at all... Regards, Brian. -- Logic empowers us and Love gives

Re: [Haskell-cafe] smallest double eps

2006-09-30 Thread Brian Hulley
Thomas Davie wrote: On 30 Sep 2006, at 17:19, Brian Hulley wrote: Lennart Augustsson wrote: Hang on, hang on, now I'm getting confused. First you asked for the smallest (positive) x such that 1+x /= x which is around x=4.5e15. 1 + 0 /= 0 0 is smaller than 4.5e15 So I don't understand

Re: [Haskell-cafe] Re: A better syntax for qualified operators?

2006-09-29 Thread Brian Hulley
Benjamin Franksen wrote: Brian Hulley wrote: ith = Data.Array.IArray.(!) Sorry, but I can't see the problem here. Why can't the editor offer the operator as '!' in the list of options, and if the user selects it insert both '(' and ')' at the right places (i.e. before the module name

Re: [Haskell-cafe] A better syntax for qualified operators?

2006-09-28 Thread Brian Hulley
Brandon Moore wrote: Brian Hulley wrote: I would *like* to be able to use the syntax: ith = Data.Array.IArray.(!) Why does the nice argument not apply equally well to infixifying things? Shouldn't I be able to write myArr Data.Arr.`get` ix Good point. This would also remove the need

Re: [Haskell-cafe] flip dot

2006-09-28 Thread Brian Hulley
On Thursday, September 28, 2006 1:33 AM, Greg Fitzgerald wrote: Since there's talk of removal of the composition operator in Haskell-prime, how about this: Instead of: foo = f . g you write: foo = .g.f A leading dot would mean, apply all unnamed parameters to the function on the right. A

[Haskell-cafe] A better syntax for qualified operators?

2006-09-27 Thread Brian Hulley
Hi - Consider the scenario when you want to find a function that returns the i'th element of an array but all you know is that there is a module called Data.Array.IArray that will probably have such a function in it. So you start typing in your program: let ith = Data.Array.IArray.

Re: [Haskell-cafe] Writing forum software in Haskell

2006-09-24 Thread Brian Hulley
David House wrote: Hi all. The recent thread on email vs. forums inspired a bit of interest to get some forum software on haskell.org. Were we to go ahead with this, I think it'd be great to have this software written in Haskell itself. [snip] * What kind of forum are we aiming at? In my

Re: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-23 Thread Brian Hulley
Andreas Marth wrote: low_l :: Word8 = fromIntegral (len .. 0x) low_h :: Word8 = fromIntegral (shiftR len 8 .. 0x) high_l :: Word8 = fromIntegral (shiftR len 16 .. 0x) high_h :: Word8 = fromIntegral (shiftR len 24 .. 0x) Hi - I just noticed the mask should be

Re: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-22 Thread Brian Hulley
Andreas Marth wrote: Thanks a lot for this information it helped a lot. Glad to be of help. I am thinking about creating a wikipage about Haskell-VBA interfacing through a DLL. Is it okay for you if I put your code there? Yes. I am a bit concerned about the memory. newArray states that

Re: [Haskell-cafe] Re: ambiguous partially defined type problem

2006-09-15 Thread Brian Hulley
Maarten wrote: Only update (see code below) is a bit ugly (I have no idea why I need fixCastUpdate) class (Show a, Typeable a) = ICustom a where [snip] update :: a - (forall b. (ICustom b) = b - b) - a update a f = f a instance ICustom Node where getVal (Node n) f = getVal n f

Re: [Haskell-cafe] Re: ambiguous partially defined type problem

2006-09-15 Thread Brian Hulley
Brian Hulley wrote: -- this change is not strictly necessary update :: a - (a - a) - a Sorry - I just looked again at the instance decl for Node, so the above change should not be made. Apologies for the multiple posts, I must try to think more before clicking send ;-) Regards

Re: [Haskell-cafe] Why am I not allowed to use CStringLen in foreignexport?

2006-09-15 Thread Brian Hulley
Andreas Marth wrote: Hi! I try to export a Haskell function to VBA. (At the moment without COM.) Because VBA seems to expect a String with length information I tried to return a CStringLen as defined in Foreign.C.String. But if I try to compile it I get an unacceptable argument type in foreign

Re: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-15 Thread Brian Hulley
Brian Hulley wrote: I assume that this means that on 32 bit Windows, the format of a BSTR is: Word16 -- low word of length Word16 -- high word of length Word16 -- first char of string ... The above is not quite correct. It appears from http://www.oreilly.com/catalog/win32api

Re: [Haskell-cafe] ambiguous partially defined type problem

2006-09-14 Thread Brian Hulley
Maarten wrote: For a project involving I use some partially defined node (in this case a simple record, in my project state transformers) in which the defined part is common to all nodes, and the custom part is different for each node. They have to become anonymous so I can put them in a list of

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-13 Thread Brian Hulley
Henning Thielemann wrote: On Wed, 13 Sep 2006, Lennart Augustsson wrote: I don't think Haskell really has the mechanisms for setting up an algebraic class hierarchy the right way. Consider some classes we might want to build: SemiGroup Monoid AbelianMonoid Group AbelianGroup SemiRing Ring ...

Re: [Haskell-cafe] Weak pointers and referential transparency???

2006-09-12 Thread Brian Hulley
[EMAIL PROTECTED] wrote: Brian Hulley wrote: [...] Ref.write proxiesRef $! (weakProxy : proxies) (This is nothing to do with your main question, but the strict application looks unnecessary there. Its right hand side is already a constructor cell.) Yes, thanks for pointing this out

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-12 Thread Brian Hulley
Bryan Burgers wrote: That being said, I'll have to play the other side of the coin: it would probably be a little bit of a pain to have to define instances of each data declaration (Integer, Int, Float, Matrix, Complex, etc.) on each of these seperate classes--especially when being in a certain

  1   2   3   4   >