[Haskell-cafe] Re: Simple newbie question - Int and Integer

2007-07-13 Thread Chris Smith
pass in a day or two to make it more respectable; but hey, I'll swallow my embarassment if people find it helpful. :) -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Maintaining the community

2007-07-15 Thread Chris Smith
t. I found out I could do so by reading this thread. Until then, I'd avoided haskell-cafe, hanging out mostly on IRC for the last few months because I didn't want the high volume of email. -- Chris Smith ___ Haskell-Cafe mailing list Haske

[Haskell-cafe] Re: Re[4]: In-place modification

2007-07-15 Thread Chris Smith
ns fail by exceeding the allowable time limit. The competition (the alg one, which is the only one anyone really cares about) is about solving problems quickly (in programmer time) and accurately. But wow, that would be great! I suppose there's not much chance of lobby

[Haskell-cafe] Re: Re: Re[4]: In-place modification

2007-07-16 Thread Chris Smith
e similar experiences. If you've competed and your programs timed out a lot, you're probably better off with better algorithms than hunting for a faster language. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Type hacking help

2007-07-19 Thread Chris Smith
$ \x y z -> y (10*x + z) digit==> '0'$ 0 digit==> '1'$ 1 digit==> '2' $ 2 digit==> '3'$ 3 digit==> 

[Haskell-cafe] Re: Re: Maintaining the community

2007-07-19 Thread Chris Smith
Andrew Coppin <[EMAIL PROTECTED]> wrote: > Chris Smith wrote: > > Well, it doesn't have to "go over" anywhere. I'm reading and posting > > just fine with NNTP right now. It works great. > > > > How'd you manage that? Andrew, sorry f

[Haskell-cafe] Definition of the Haskell standard library

2007-07-30 Thread Chris Smith
r web sites for the thousandth time before realizing that so-and-so's GUI library hasn't actually been touched since they finished their class project in 1998 and doesn't build with the latest version of Qt or whatever. -- Chris Smith _

[Haskell-cafe] RE: Definition of the Haskell standard library

2007-07-31 Thread Chris Smith
is if we should just rely on mechanisms in hackage to > distinguish the gems from the failed experiments or something more > centralised. Good question. I would guess the best way to answer it is to simultaneously establish something centralized in the short term, and then try to develop the technological structures to make it obsolete. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

RE: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-07-31 Thread Chris Smith
n/sh ls ../ghc/libraries/*/prologue.txt \ | sed 's/\(\.\.\/ghc\/libraries\/\([^\/]*\)\/prologue.txt\)/cp \1 \/usr\/local\/share\/ghc\/doc\/html\/\2/' \ | sudo /bin/sh cd /usr/local/share/ghc/doc/html sudo ./gen_contents_index -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] monad subexpressions

2007-08-02 Thread Chris Smith
$( expr ) -- conflicts with template haskell ( <- expr ) -- makes sense, and I think it's unambiguous Other ideas: ``expr`` -- back-ticks make sense for UNIX shell scripters (| expr |) -- I don't think anything uses this yet Thoughts? -- Chris Smith __

[Haskell-cafe] Re: monad subexpressions

2007-08-02 Thread Chris Smith
atter seems sensible as well. Any other ideas? -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: monad subexpressions

2007-08-02 Thread Chris Smith
ave an objection, given that yes it does force parenthesizing. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: monad subexpressions

2007-08-03 Thread Chris Smith
to be able to rewrite (mapM f xs) as (map (<- f) xs), or something like that. In other words, the syntax lies to me. At the moment, though, I can't think of anything better. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.o

[Haskell-cafe] Re: monad subexpressions

2007-08-03 Thread Chris Smith
afe code written in Python or Ruby) as long as this is the case. I find it hard to speculate that Haskell programmers will understand the alternatives, but won't understand something like "monadic subexpressions are evaluated in the order of their closing parentheses". -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: monad subexpressions

2007-08-03 Thread Chris Smith
d. Outside a do block, > monadic subexpressions are banned. Sure. SPJ mentioned that you wouldn't promote (<- x) past a lambda. I'm not convinced (it seems to fall into the same category as the if statement), but it's worth considering. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] RE: monad subexpressions

2007-08-03 Thread Chris Smith
expect... but mind-reading is hard, and it's more consistent to just say "find the innermost containing do block" than make up new rules for each piece of syntax. Granted, a special case of "it's an error" is far more appealing than the corresponding special case fo

[Haskell-cafe] Re: monad subexpressions

2007-08-03 Thread Chris Smith
; c } > > is still the same as > > do { a; do { b; c } } > > yes? no? perhaps? sometimes? how long did it take you? I'm not entirely sure I understand the point here. The monad laws are defined in terms of >>= and return. They have never had anything

[Haskell-cafe] Re: Re: monad subexpressions

2007-08-03 Thread Chris Smith
sugar the following? getA :: Friggle MyA getB :: Friggle MyB foo :: Int -> MyB -> Friggle MyC do a <- getA b <- getB a foo 42 b -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: Re: monad subexpressions

2007-08-03 Thread Chris Smith
; and a little uneasy about the use of case, if, lambdas, etc. Time to keep thinking, I guess. I'd like to take Simon's suggestion and do a wiki page about this; but it should probably be on the Haskell prime wiki, no? I'm not entirely clear on

[Haskell-cafe] Re: Re: Re: monad subexpressions

2007-08-03 Thread Chris Smith
let x = (<- x) ... Then this would become: do let x = return 12 t1 <- x let x = t1 ... Which is, in turn: let x = return 12 in x >>= (\t1 -> let x = t1 in ...) -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: monad subexpressions

2007-08-03 Thread Chris Smith
o far as I know. I am just trying to discuss the best way to solve this problem. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Update on monad subexpressions

2007-09-03 Thread Chris Smith
time student, applying to graduate schools, and some volunteer work that I'm not willing to give up, I simply have no remaining time, and won't until about December or later. If someone else wants to pick up this project, please go for it. Otherwise, I'll get to it when I

[Haskell-cafe] Are type synonym families really equivalent to fundeps?

2007-09-03 Thread Chris Smith
(Var x) a) (x -> b) c instance (Action t a b c) => Action t (RHS [t] a) b c -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Are type synonym families really equivalent to fundeps?

2007-09-03 Thread Chris Smith
ns are using different types for 't'. As I said, this is probably not really right, since () really doesn't determine a value for a; but it does work right now. Just for kicks, I tried this: type instance A_T () = forall t. t it didn't work. -- Chris Smith

[Haskell-cafe] How to do this in Haskell

2007-11-10 Thread Chris Smith
tion tool or Template Haskell, and then using that to try to embed the Mozilla editor component. Given my serious lack of knowledge in XP-COM or the Mozilla project or GTK, that looks sort of scary. Any other ideas? -- Chris Smith ___ Haskell-

[Haskell-cafe] Re: How to do this in Haskell

2007-11-11 Thread Chris Smith
zilla editor component, and wondering if there are other components that could be used instead in a Gtk2Hs application. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Weird ghci behaviour?

2007-11-12 Thread Chris Smith
This is not new with GHC 6.8. For example, it's why I had to sneakily add a module declaration to the top of a source file when I wrote > http://www.haskell.org/haskellwiki/Learn_Haskell_in_10_minutes#Function_definitions -- Chris Smith

[Haskell-cafe] Hit a wall with the type system

2007-11-28 Thread Chris Smith
= AD (acosh x) (e / sqrt (x^2 - 1)) > atanh (AD x e)= AD (atanh x) (e / (1 - x^2)) > > diffNum:: Num b=> (forall a. Num a=> a -> a) -> b -> b > diffFractional :: Fractional b => (forall a. Fraction

[Haskell-cafe] Re: Hit a wall with the type system

2007-11-28 Thread Chris Smith
;. The syntax is made up, of course, and entirely unworkable since (:>) is a user-definable contructor name... but that's the intuition anyway. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Hit a wall with the type system

2007-11-28 Thread Chris Smith
e at that point. But another part of it is endemic; for example, f x = if signum x == (-1) then (-x) else x redefines the absolute value function, which is not differentiable at 0, but this implementation will claim f'(0) = 1, and there's no obvious way to avoid it without changing

[Haskell-cafe] Re: Hit a wall with the type system

2007-11-28 Thread Chris Smith
ons here are defined over real numbers rather than *merely* intervals, because the type given for diffNum, for example, requires that the first parameter be no more specific than Num a => a -> a... so one may not actually pass in a function of type Int ->

[Haskell-cafe] Re: Re: Hit a wall with the type system

2007-11-29 Thread Chris Smith
l. So I want the parameter to be more restricted. No one is going to write a function that *only* works on AD types. Instead, the parameter to diff ought to be required to be polymorphic. The rank n type does that, but it loses the ability to get the most general possible result type. -- Chris

[Haskell-cafe] Re: Re: Re: Hit a wall with the type system

2007-11-29 Thread Chris Smith
ht answer, then I'll have to back up and try to understand how. It seems pretty clear to me that it breaks abstraction in a way that is really rather dangerous. If you mean you think it's good enough, then yes, I pretty much have conluded it's at least the best that's

[Haskell-cafe] Re: Haskell interface file (.hi) format?

2007-11-29 Thread Chris Smith
s code to read and write it in compiler/iface/BinIface.hs in any GHC source tree. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Possible extension to Haskell overloading behavior

2013-07-08 Thread Chris Smith
So I've been thinking about something, and I'm curious whether anyone (in particular, people involved with GHC) think this is a worthwhile idea. I'd like to implement an extension to GHC to offer a different behavior for literals with polymorphic types. The current behavior is something like: 1.

Re: [Haskell-cafe] Possible extension to Haskell overloading behavior

2013-07-08 Thread Chris Smith
n Mon, Jul 8, 2013 at 12:54 PM, Chris Smith wrote: > So I've been thinking about something, and I'm curious whether anyone > (in particular, people involved with GHC) think this is a worthwhile > idea. > > I'd like to implement an extension to GHC to offer a dif

Re: [Haskell-cafe] Possible extension to Haskell overloading behavior

2013-07-09 Thread Chris Smith
esn't help. On Tue, Jul 9, 2013 at 11:46 AM, Aleksey Khudyakov wrote: > On 08.07.2013 23:54, Chris Smith wrote: >> >> So I've been thinking about something, and I'm curious whether anyone >> (in particular, people involved with GHC) think this is a wort

Re: [Haskell-cafe] Possible extension to Haskell overloading behavior

2013-07-09 Thread Chris Smith
Oh, never mind. In this case, I guess I don't need an extension at all! On Tue, Jul 9, 2013 at 1:47 PM, Chris Smith wrote: > Oh, yes. That looks great! Also seems to work with OverloadedStrings > in the natural way in GHC 7.6, although that isn't documented. > > Now i

Re: [Haskell-cafe] Possible extension to Haskell overloading behavior

2013-07-09 Thread Chris Smith
as to add 'import Prelude' to the top of their code. Am I missing something? On Tue, Jul 9, 2013 at 1:51 PM, Chris Smith wrote: > Oh, never mind. In this case, I guess I don't need an extension at all! > > On Tue, Jul 9, 2013 at 1:47 PM, Chris Smith wrote: >> Oh,

Re: [Haskell-cafe] Possible extension to Haskell overloading behavior

2013-07-09 Thread Chris Smith
the suggestion! On Jul 9, 2013 4:20 PM, "Aleksey Khudyakov" wrote: > On 10.07.2013 01:13, Chris Smith wrote: > >> Ugh... I take back the never mind. So if I replace Prelude with an >> alternate definition, but don't use RebindableSyntax, and then hide >> the b

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Chris Smith
I second the recommendation to look at Haste. It's what I would pick for a project like this today. In the big picture, Haste and GHCJS are fairly similar. But when it comes to the ugly details of the runtime system, GHCJS adopts the perspective that it's basically an emulator, where compatibili

[Haskell-cafe] Haskell job opening

2008-03-30 Thread Chris Smith
eveloper" within a very short time. Hope this is of interest. -- Chris Smith Lead Software Developer, MindIQ Corporation ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: How can I represent 4x4 map in haskell

2008-03-31 Thread Chris Smith
re are several different meanings for "map", and I don't see which one you mean. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Homework wiki page (was Re: How can I represent 4x4 map in haskell)

2008-03-31 Thread Chris Smith
;d have been rather put off if that wiki page had been my first introduction to the Haskell community. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: FW: Haskell

2008-04-01 Thread Chris Smith
Just random thoughts here. Andrew Bagdanov wrote: > Well, if I don't have side effects (and don't mind extra, unneeded > evaluations), I can write my conditionals as functions in Scheme too. > Heck, now that I think of it I can even avoid those extra evaluations > and side-effect woes if i require

[Haskell-cafe] Re: Function Precedence

2008-04-01 Thread Chris Smith
nlikely to me, but perhaps everyone will agree, once they see it, that it is in fact better than the current parsing rules. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Function Precedence

2008-04-01 Thread Chris Smith
ated languages that left associativity for function application works best. > I'm beginning to wonder if I fully understand the right associativity > rule for the -> operator. It just means that if I have a string of things separated by ->, I can put parentheses around all

[Haskell-cafe] Re: FW: Haskell

2008-04-01 Thread Chris Smith
#x27;m fairly confident everything there is accurate, but I trust someone will correct me if that confidence is misplaced. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Function Precedence

2008-04-03 Thread Chris Smith
Hans Aberg wrote: > This problem is not caused by defining f+g, but by defining numerals as > constants. Yup. So the current (Num thing) is basically: 1. The type thing is a ring 2. ... with signs and absolute values 3. ... along with a natural homomorphism from Z into thing 4. ... and with Eq a

[Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-03 Thread Chris Smith
t reproduce it on a 64- bit system. There, instead of hanging for about a minute before printing out the list, it would hang for about 4 billion minutes. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Precedence (Part 2)

2008-04-03 Thread Chris Smith
PR Stanley wrote: Just a meta-point. The dash-dash-space sequence introduces a signature. If you write your reply after the dash-dash-space, as you did here, a lot of us won't see your reply because we have our mail/news clients set up to ignore signatures. I had to view the original message

[Haskell-cafe] Re: Shouldn't this loop indefinitely => take (last [0..]) [0..]

2008-04-04 Thread Chris Smith
of 'length' may result in an inferred type of Int for half the numbers in the program. The problem is likely to be in a piece of code completely unrelated to where the symptoms occur. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-

[Haskell-cafe] Strange message from GHC

2008-04-14 Thread Chris Smith
I'm running into this in some code I wrote. What does it mean? It says to look at -fspec-constr-count, but that flag doesn't seem to be in the GHC documentation. This isn't critical; the code still seems to work fine. It just makes the build uglier. Thanks. Message below. SpecConstr: too

[Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Chris Smith
next time around. Is it really safe to not retry the transaction? -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-23 Thread Chris Smith
ng away the old value; then always do 2b if the predicate succeeds. That would involve considerably less bookkeeping, at the expense of replaying some transactions unnecessarily. Then readTVarWhen would basically be special only if it's the first access

[Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-24 Thread Chris Smith
der to work with a TVar, I need to know whether anything that came before me might have modified it, and if so take the current value as a parameter instead of reading it like normal. Or am I misunderstanding something? -- Chris Smith ___ Haskell-Caf

[Haskell-cafe] Re: [Haskell] ANN: random-access-list-0.1

2008-06-12 Thread Chris Smith
Chaddaï Fouché wrote: > Given that this structure isn't lazy enough, I really don't see a > problem with using Int (any random access list with a size that needs an > Integer would blow the memory anyway...). Bad way to think about things. The implications of using Int as the result type of a fu

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Chris Smith
some special-purpose rules about functions that operate on that value... an arguably clearer way to understand non-termination is as a side-effect that Haskell does NOT isolate in the type system. But that's for another time. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Chris Smith
of syntactic forms as they manifest themselves in impure languages. That is the point of what people are saying here (pedantry or not is a matter of your taste); it's directly relevant to day to day programming in Haskell. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] On the purity of Haskell /Random generators

2011-12-29 Thread Chris Smith
o broken due to something as trivial as inlining by the compiler (see the ugly NOINLINE annotations often used with unsafePerformIO tricks for initialization code for an example). -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.o

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Chris Smith
y something isn't "evaluated" just because the effect it describes haven't been performed. It's exactly that distinction -- the refusal to conflate evaluation with performing effects -- that is referred to when Haskell is called a pure language. -- Chris Smith __

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Chris Smith
;s all beside the point. If you need to know how your compiler is implemented to answer questions about language semantics, you've failed already. Purity isn't about the RTS implementation, which is of course plenty effectful and involves lots of destructive updates. It's

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Chris Smith
time comes up. The meanings of values in those specific complex types doesn't affect anything except those expressions that deal explicitly with that type. THAT is why it's so crucial that values of IO types are just ordinary values, not

Re: [Haskell-cafe] Level of Win32 GUI support in the Haskell platform

2011-12-29 Thread Chris Smith
k (aka Gtk2Hs) and wx packages for that. I've never been able to get wx to build, but gtk works fine. Others (mostly those using macs) report the opposite. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Chris Smith
at abstraction boundary. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Chris Smith
result when you o it twice. What Conal is getting at is that we don't have a formal model of what an IO action means. Nevertheless, we know because f is a function, that when it is applied twice to the same argument, the values we get back (which

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Chris Smith
s and evaluation rather than having a way to talk about it is handicapping yourself from a denotational perspective. Rather, what would be an advantage (but also rather hopeless) would be to define the notion of doing an action more precisely. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Chris Smith
talking about "functions" are using the word to mean a computational procedure, the sort of thing meant by the C programming language by that word. Uncomputable is a very poor word for that idea. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Chris Smith
g can be assigned, f will be a valid function on non-bottom values. Not perfect, but close. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Are all monads functions?

2011-12-31 Thread Chris Smith
On Dec 31, 2011 8:19 AM, "Yves Parès" wrote: > -- The plain Maybe type > data Maybe a = Just a | Nothing > > -- The MaybeMonad > newtype MaybeMonad a = MM ( () -> Maybe a ) > > That's what using Maybe as a monad semantically means, doesn't it? I'd have to say no. That Maybe types are isomorphic

Re: [Haskell-cafe] Summer of Code idea: Haskell Web Toolkit

2012-03-06 Thread Chris Smith
My first impression on this is that it seems a little vague, but possibly promising. I'd make it clearer that you plan to contribute to the existing UHC stuff. A first glance left me with the impression that you wanted to re-implement a JavaScript back end, which would of course be a non-starter

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-11 Thread Chris Smith
= pipe id). You could kludge the identity pipes and make that law hold, and I *think* you'd even keep associativity in the process so you would technically have a category again. But this hints to me that there is some *other* law you should expect to hold with regard to the interactio

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-11 Thread Chris Smith
termination: if p2 terminates first in the left hand side, you don't want the unawait to occur. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-11 Thread Chris Smith
gt;> p)) = (q >+> idP) = q. Yes, q can be exhausted, but when it is, idP will await input, which will immediately terminate the (idP >> p) pipe, producing the result from q, and ignoring p entirely. -- Chris Smith ___ Haskell-Cafe mailin

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-11 Thread Chris Smith
this is that a (ChunkedPipe a b m r) can NOT be modelled correctly as a (Pipe a b m r). -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-11 Thread Chris Smith
forP yield Yep, looks like idP is still the identity. Of course, the real reason (aside from the fact that you can check and see) is that forP isn't definable at all in Gabriel's pipes package. -- Chris Smith ___ Haskell-Cafe m

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-12 Thread Chris Smith
of of the category laws for your new code without ensure. It will then be interesting to see how that compares to Gabriel's approach, which at this point we've heard a bit about but I haven't seen. -- Chris Smith ___ Haskell-Cafe mail

Re: [Haskell-cafe] Empty Input list

2012-03-12 Thread Chris Smith
or before) the existing equation, add: tmp [] y = (-1, -1) Or, you may want to use a Maybe type for the return... which would mean there *is* a Nothing value you can return: tmp:: [(Int, Int)] -> Int -> Maybe (Int, Int) tmp (x:xs) y        | y == 1 = Just x        | y > 1

Re: [Haskell-cafe] Empty Input list

2012-03-12 Thread Chris Smith
Oh, and just to point this out, the function you're writing already exists in Data.List. It's called (!!). Well, except that it's zero indexed, so your function is more like: tmp xs y = xs !! (y-1) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.or

Re: [Haskell-cafe] Empty Input list

2012-03-12 Thread Chris Smith
-> Int -> (Int, Int) tmp xs y = case drop (y-1) xs of [] -> (0,0) Just (x:_) -> x -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Chris Smith
or all known examples where that happens, lazy evaluation (which can be seen as a controlled benign mutation) is enough to recover the optimal asymptotics. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Chris Smith
lly examples like "the CPU gives off heat" or FFI/unsafe stuff like unsafePerformIO.) So maybe we should ideally call them just "effects". But since so many other languages use functions to describe effectful actions, the term has stuck. So pretty much when someon

Re: [Haskell-cafe] Google Summer of Code - Lock-free data structures

2012-03-18 Thread Chris Smith
n quality implementations than even six or seven at a student project level. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Are there arithmetic composition of functions?

2012-03-19 Thread Chris Smith
If you are willing to depend on a recent version of base where Num is no longer a subclass of Eq and Show, it is also fine to do this: instance Num a => Num (r -> a) where (f + g) x = f x + g x fromInteger = const . fromInteger and so on. ___ Ha

Re: [Haskell-cafe] Are there arithmetic composition of functions?

2012-03-19 Thread Chris Smith
On Mar 19, 2012 11:40 AM, "Ozgur Akgun" wrote: > {-# LANGUAGE FlexibleInstances #-} > > instance Num a => Num (a -> a) where You don't want (a -> a) there. You want (b -> a). There is nothing about this that requires functions to come from a numeric type

Re: [Haskell-cafe] Google Summer of Code idea of project & application

2012-03-19 Thread Chris Smith
there are other people that care a lot more about ML than I do. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Are there arithmetic composition of functions?

2012-03-19 Thread Chris Smith
ment about if you're willing to depend on a recent version of base. Effectively, this means requiring a recent GHC, since I'm pretty sure base is not independently installable. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@hask

Re: [Haskell-cafe] Google Summer of Code idea of project & application

2012-03-19 Thread Chris Smith
the advanced language features or libraries, but just because re-implementing the whole front end of a compiler for even a limited but useful subset of Haskell is a ludicrously ambitious and risky project for GSoC. -- Chris Smith ___ Haskell-Cafe mailing

Re: [Haskell-cafe] adding the elements of two lists

2012-03-25 Thread Chris Smith
writing instances. Here there's no good way to write an instance that obeys the laws, so it's better to write no instance at all. -- Chris Smith ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] adding the elements of two lists

2012-03-25 Thread Chris Smith
Jerzy Karczmarczuk wrote: > Le 26/03/2012 01:51, Chris Smith a écrit : > >>     instance (Num a) => Num [a] where >>     xs + ys = zipWith (+) xs ys >> >> You can do this in the sense that it's legal Haskell... but it is a bad idea >> [...] > I

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Chris Smith
Jerzy Karczmarczuk wrote: > Le 26/03/2012 02:41, Chris Smith a écrit : >> Of course there are rings for which it's possible to represent the >> elements as lists.  Nevertheless, there is definitely not one that >> defines (+) = zipWith (+), as did the one I was respon

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Chris Smith
in the question, and that defining a Num instance is possible, but a bad idea because there's not a canonical way to define a ring on lists. The rest of this seems to have devolved into quite a lot of bickering and one-ups-manship, so I'll back out now.

Re: [Haskell-cafe] open source project for student

2012-04-11 Thread Chris Smith
Hmm, tough to answer without more to go on. I think if I were in your shoes I'd ask myself where I'm most happy outside of programming. A lot of good entry level open source work involves combining programming with other skills. Are you an artist? Have a talent for strong design and striking ex

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.1.0

2012-04-17 Thread Chris Smith
Paolo, This new pipes-core release looks very nice, and I'm happy to see exception and finalizer safety while still retaining the general structure of the original pipes package. One thing that Gabriel and Michael have been talking about, though, that seems to be missing here, is a way for a pipe

[Haskell-cafe] Fwd: Problem with forall type in type declaration

2012-05-04 Thread Chris Smith
Oops, forgot to reply-all again... -- Forwarded message -- From: Chris Smith Date: Fri, May 4, 2012 at 8:46 AM Subject: Re: [Haskell-cafe] Problem with forall type in type declaration To: Magicloud Magiclouds On Fri, May 4, 2012 at 2:34 AM, Magicloud Magiclouds wrote: > So

[Haskell-cafe] Current uses of Haskell in industry?

2012-06-13 Thread Chris Smith
It turns out I'm filling in for a cancelled speaker at a local open source user group, and doing a two-part talk, first on Haskell and then Snap. For the Haskell part, I'd like a list of current places the language is used in industry. I recall a few from Reddit stories and messages here and othe

Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needs your help

2012-07-06 Thread Chris Smith
Whoops, my earlier answer forgot to copy mailing lists... I would love to see \of, but I really don't think this is important enough to make case sometimes introduce layout and other times not. If it's going to obfuscate the lexical syntax like that, I'd rather just stick with \x->case x of. On Ju

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-16 Thread Chris Smith
I am tentatively in agreement that upper bounds are causing more problems than they are solving. However, I want to suggest that perhaps the more fundamental issue is that Cabal asks the wrong person to answer questions about API stability. As a package author, when I release a new version, I kno

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-16 Thread Chris Smith
Twan van Laarhoven wrote: > Would adding a single convenience function be low or high risk? You say it > is low risk, but it still risks breaking a build if a user has defined a > function with the same name. Yes, it's generally low-risk, but there is *some* risk. Of course, it could be high ris

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-02 Thread Chris Smith
On Sun, Sep 2, 2012 at 9:40 AM, wrote: > The thing is, that one ALWAYS wants to create a union of types, and not > merely an ad-hock list of data declarations. So why does it take more code > to do "the right thing(tm)" than to do "the wrong thing(r)"? You've said this a few times, that you run

  1   2   3   >