Re: [Haskell-cafe] Chuan-Kai Lin's Unimo framework
Le Tue, 13 Dec 2011 02:23:18 -0500, Brent Yorgey byor...@seas.upenn.edu a écrit : No, but if you want to define monads operationally I would instead recommend using the 'operational' package: http://hackage.haskell.org/package/operational It does actually have examples. Anyway, it seems like Unimo is not even on Hackage. Thank you very much for the reference. Indeed it seems that Unimo has not been really developped see: http://sneezy.cs.nott.ac.uk/fplunch/weblog/?p=89 jean-luc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] acid state
On Tue, Dec 13, 2011 at 4:55 AM, Anatoly Yakovenko aeyakove...@gmail.com wrote: So I am trying to understand how acid state works. The HelloWorld example has a type Message = String data Database = Database [Message] $(deriveSafeCopy 0 'base ''Database) -- Transactions are defined to run in either the 'Update' monad -- or the 'Query' monad. addMessage :: Message - Update Database () addMessage msg = do Database messages - get put $ Database (msg:messages) It seems to me that since the Dababase is a list of messages every update would require acid-state to rewrite the list into the file, so each update would get slower as the list gets bigger, but what I am seeing is that updates are constant time regardless of the size of the list. So how does it work? acid-state doesn't write the whole thing to the disk every time there's a transaction. Instead, it just writes the transaction on a transaction log. So it will just write something like AddMessage msg to the disk. Periodically, checkpoints are created which *do* have all your data inside them (but even so, checkpoints are written asynchronously). Cheers, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] AFRP is not (necessarily) imperative
x = constant 3 ^+^ time If I understand the rest of your mail, Wire defines an Applicative instance, so why not: x = (+3) $ time ?? 2011/12/12 Ertugrul Söylemez e...@ertes.de Hello fellows, after a few discussions on IRC and via private mail I feel obligated to point out that arrows and in particular AFRP do not force you to use an imperative style in any way. You can use a style very similar to SHE's idiom brackets. I will demonstrate this using the Netwire library. The following code has a very imperative feel to it and also looks quite ugly: myWire = proc _ - do fps - avgFpsInt 1000 100 - () t - time - () let x = 3 + t y - integral 0 - t returnA - printf %8.2f %8.2f %8.2f fps x y Let's improve this code. The magic lies in identifying behaviors from classic FRP. The arrow variables from the above code can be seen as the behaviors, but that's not very useful for getting rid of the imperative style. A better way to look at it is that every wire that ignores its input (i.e. has a fully polymorphic input type) is a behavior, so let's find them. First of all it is impossible to write a proper Num instance for wires. The underlying problem is the same as for writing a Num instance for functions. However, the Wire type forms a vector space, and the next release of Netwire will include the corresponding instances (see the vector-space package by Conal Elliot). With them we can write: x = constant 3 ^+^ time The x wire is our first behavior. Passing x to a generic wire is simply regular arrow composition, giving you behaviors as functions of other behaviors, hence: y = integral 0 x Also fps is just a simple behavior: fps = avgFpsInt 1000 100 To get to the final output there are multiple ways. Perhaps the nicest way is to exploit the Applicative instance, giving you: myWire = liftA3 (printf %8.2f %8.2f %8.2f) fps x y where fps = avgFpsInt 1000 100 x = constant 3 ^+^ time y = integral 0 x Looks much more declarative, no? For more complicated compositions or generic wires use banana brackets or the combinator syntax in arrow notation. Examples: myWire = proc x - (someWire - x) ^+^ (otherWire - 15) myWire = proc x - (| f (someWire - x) (otherWire - 15) |) This closely resembles idiom bracket notation, but allows you to be explicit about inputs, takes care of creating side channels and gives you the full power of arrows, including ArrowChoice and ArrowLoop. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] indentation blues
Hello, On 13.12.2011, at 08:51, Adrien Haxaire wrote: Hello, I don't know how the indent.hs file works for the vim mode, but as you are asking for another indent.hs file, here is the link to the indent.hs file in emacs haskell-mode: https://github.com/jwiegley/haskell-mode/blob/8067b7547f047352c41af2374e3246b5504c7741/indent.hs Maybe you can use it in the vim mode ? If not, the emacs haskell mode is nice, and coming from vim you wouldn't spend much time learning emacs. there is also a vi emulator I think, though I haven't tested it. On Mon, 12 Dec 2011 16:50:24 -0800, Martin DeMello wrote: The vim autoindent for haskell is really bad :( Is there a better indent.hs file floating around somewhere? Alternatively, is the emacs haskell mode better enough that it's worth my time learning my way around emacs and evil? Yes, the haskell-emacs is nice. It provides two separate implementations of indentation engines: haskell-indent and haskell-indentation. And you can use emacs default indentation. I use haskell-indent because it considers the right indentation candidates for my coding style [1]. Regarding, your question whether this is worth switching from vim to emacs. I've been using both editors for some years and I very much doubt, that you wouldn't spend much time learning emacs. If you are comfortable with vim, stick with it, unless you are interested in Emacs or one of its really great modes: org and auctex/reftex. Regarding, the vi emulations, I'd say they are nice should you ever be forced to use emacs for some time. But I don't recommend them, I've tried them all. They are not the real thing. Most of them are vi not vim emulators. And they always feel like second class citizens in emacs land. YMMW. [1]: But I am not able to configure it to place where where I like it, indented by half the normal indentation width. Cheers, Jean ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking
I got the program installed after creating the libstdc++.so symlink. No ink shows up from my drawing though. I am on a Thinkpad X201 Tablet and xournal works. I am glad you are experimenting with window splits. I think the worst part of xournal is it constrains you to a notebook-width piece of paper. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] indentation blues
Regarding, your question whether this is worth switching from vim to emacs. I've been using both editors for some years and I very much doubt, that you wouldn't spend much time learning emacs. If you are comfortable with vim, stick with it, unless you are interested in Emacs or one of its really great modes: org and auctex/reftex. Regarding, the vi emulations, I'd say they are nice should you ever be forced to use emacs for some time. But I don't recommend them, I've tried them all. They are not the real thing. Most of them are vi not vim emulators. And they always feel like second class citizens in emacs land. YMMW. Thanks for your feedback. I've never tried vim so I couldn't tell precisely. I thought the emulations were nice enough to save time learning emacs. If they are second class citizens, I agree it would be wiser to stick with vim then. Adrien ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] indentation blues
On Tue, Dec 13, 2011 at 2:34 AM, Adrien Haxaire adr...@haxaire.org wrote: Regarding, your question whether this is worth switching from vim to emacs. I've been using both editors for some years and I very much doubt, that you wouldn't spend much time learning emacs. If you are comfortable with vim, stick with it, unless you are interested in Emacs or one of its really great modes: org and auctex/reftex. Regarding, the vi emulations, I'd say they are nice should you ever be forced to use emacs for some time. But I don't recommend them, I've tried them all. They are not the real thing. Most of them are vi not vim emulators. And they always feel like second class citizens in emacs land. YMMW. Thanks for your feedback. I've never tried vim so I couldn't tell precisely. I thought the emulations were nice enough to save time learning emacs. If they are second class citizens, I agree it would be wiser to stick with vim then. yeah, i was assuming the emulations were nice enough to support my vim habits too. if they aren't, not even a good haskell mode would make emacs comfortable enough to use given my years of ingrained vim. martin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] indentation blues
On 13.12.2011, at 11:43, Martin DeMello wrote: On Tue, Dec 13, 2011 at 2:34 AM, Adrien Haxaire adr...@haxaire.org wrote: Regarding, your question whether this is worth switching from vim to emacs. I've been using both editors for some years and I very much doubt, that you wouldn't spend much time learning emacs. If you are comfortable with vim, stick with it, unless you are interested in Emacs or one of its really great modes: org and auctex/reftex. Regarding, the vi emulations, I'd say they are nice should you ever be forced to use emacs for some time. But I don't recommend them, I've tried them all. They are not the real thing. Most of them are vi not vim emulators. And they always feel like second class citizens in emacs land. YMMW. Thanks for your feedback. I've never tried vim so I couldn't tell precisely. I thought the emulations were nice enough to save time learning emacs. If they are second class citizens, I agree it would be wiser to stick with vim then. yeah, i was assuming the emulations were nice enough to support my vim habits too. if they aren't, not even a good haskell mode would make emacs comfortable enough to use given my years of ingrained vim. I am not saying they are bad, but when I returned to emacs after two years of using vim, I was disappointed by their functionality and especially by the integration between third-party emacs-modes and the vi emulations. Though, I believe there is some work on new vim emulators. I am not sure on their status. They are probably no non-brainer option, yet. What I really liked about Claus Reinke's haskell-mode for vim was the ability to insert update statements with one command. Cheers, Jean ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: Anansi 0.4.2 (literate programming pre-processor)
On Sun, Dec 11, 2011 at 04:22, John Millikin jmilli...@gmail.com wrote: Anansi is a preprocessor for literate programs, in the model of NoWeb or nuweb. Literate programming allows both computer code and documentation to be generated from a single unified source. Home page: https://john-millikin.com/software/anansi/ Hackage: http://hackage.haskell.org/package/anansi-0.4.2 - This release has a couple cool new features, suggested by Dirk Laurie. Markdown loom === Markdown, a lightweight markup language similar to ReStructuredText, is used often on web forums. Use [[ :loom anansi.markdown ]] in your documents to enable. This announcement made me motivated to finally have a closer look at LP. Thanks for a rather excellent tool :) There were some things that I bumped into though: 1. What to call files? I understand (C)WEB suggests using .w, and that noweb uses .nw, what should I call anansi files? 2. Combining anansi and pandoc works quite well for HTML, but it fails miserably when trying to use the generated LaTeX: markdown2pdf: ! LaTeX Error: Command \guillemotleft unavailable in encoding OT1. Is there any good way to get around that? 3. Is there any editor support for anansi, syntax highlihgting etc? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking program written in haskell
Unfortunately, I have all the *-dev packages I need. Like somebody else said, it's a different problem. Linking the file worked for me. Cheers On 13 December 2011 02:43, Brandon Allbery allber...@gmail.com wrote: On Mon, Dec 12, 2011 at 19:22, Ian-Woo Kim ianwoo...@gmail.com wrote: A workaround is to make a symbolic link to libstdc++.so.6 with the name of libstdc++.so in /usr/lib or /usr/local/lib or other dynamic library path like the following. ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so This is an indication that you have not installed your distribution's -dev package for the library in question. You should do so instead of making the symlink manually. (cabal has no support for this kind of thing) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking program written in haskell
In other news, the program runs, but I can't draw anything. I tried it with a wacom and a mouse. Ian-Woo, let me know if you need me to run some tests or to try a new version before you release it. As a fan of xournal, I'd be glad to do so. Cheers, Ivan. On 13 December 2011 14:00, Ivan Perez ivanperezdoming...@gmail.com wrote: Unfortunately, I have all the *-dev packages I need. Like somebody else said, it's a different problem. Linking the file worked for me. Cheers On 13 December 2011 02:43, Brandon Allbery allber...@gmail.com wrote: On Mon, Dec 12, 2011 at 19:22, Ian-Woo Kim ianwoo...@gmail.com wrote: A workaround is to make a symbolic link to libstdc++.so.6 with the name of libstdc++.so in /usr/lib or /usr/local/lib or other dynamic library path like the following. ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so This is an indication that you have not installed your distribution's -dev package for the library in question. You should do so instead of making the symlink manually. (cabal has no support for this kind of thing) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Sharing on equality
Hey all, Can GHC eliminate one of two equal ByteStrings, when they are compared and turns out to be equal? Say i have a map, ByteString - Int. I now do a lookup on a ByteString and if it exists, I insert this ByteString into a list. Is it possible to avoid using more memory, than used by the keys in the map + the list structure? I.e. is it possible to eliminate the redundant ByteStrings somehow? I guess, this could be done by having lookup return the key as well, and then insert this key into the list, however, that's a bit ugly and somewhat anti-intuitive. Here's an example program, to illustrate the idea: https://gist.github.com/1472418 -- Johan Brinch ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Typechecking Using GHC API
Hi, I do some pre-processing on a normal Haskell code ( -F ). The pre-processor needs to know the type of each expression. What are the possibilities to do so? Can I use GHC API to employ GHC type checker? If yes, any good tutorial? Is it too naive to think of a function, f :: String - AnnotatedAST , that takes Haskell code and returns its corresponding abstract syntax tree annotated with types? Thanks, /shayan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] acid state
Ah, i think i get it. On Tue, Dec 13, 2011 at 12:48 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Tue, Dec 13, 2011 at 4:55 AM, Anatoly Yakovenko aeyakove...@gmail.com wrote: So I am trying to understand how acid state works. The HelloWorld example has a type Message = String data Database = Database [Message] $(deriveSafeCopy 0 'base ''Database) -- Transactions are defined to run in either the 'Update' monad -- or the 'Query' monad. addMessage :: Message - Update Database () addMessage msg = do Database messages - get put $ Database (msg:messages) It seems to me that since the Dababase is a list of messages every update would require acid-state to rewrite the list into the file, so each update would get slower as the list gets bigger, but what I am seeing is that updates are constant time regardless of the size of the list. So how does it work? acid-state doesn't write the whole thing to the disk every time there's a transaction. Instead, it just writes the transaction on a transaction log. So it will just write something like AddMessage msg to the disk. Periodically, checkpoints are created which *do* have all your data inside them (but even so, checkpoints are written asynchronously). Cheers, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking program written in haskell
Hi, Ivan, Thank you very much for testing. Yes, I need to have many testers. For your problem, first, please send me the console output of hxournal when you start the application. I guess its stylus name problem in X11 setting. Currently, the detection of wacom pen in hxournal is by checking a xinput device which is named as stylus. (as defined in Xorg.conf in /etc/X11/) So you need to change X11 name to stylus or modify line 23 of the source code csrc/c_initdevice.c . I am going to modify this soon. (not yet figured out how to detect the tablet generally, so I am thinking of making a configuration file for hxournal which has an information of the device. ) It has another problem that it always connects to wacom pen if you have wacom tablet, so mouse input is ignored. I need to enable user to choose mouse/wacom input. I released it rather early for getting some attention of interested people. Let me notify you when modifying the code. Thank you again for your interest. Ian-Woo On Tue, Dec 13, 2011 at 8:03 AM, Ivan Perez ivanperezdoming...@gmail.com wrote: In other news, the program runs, but I can't draw anything. I tried it with a wacom and a mouse. Ian-Woo, let me know if you need me to run some tests or to try a new version before you release it. As a fan of xournal, I'd be glad to do so. Cheers, Ivan. On 13 December 2011 14:00, Ivan Perez ivanperezdoming...@gmail.com wrote: Unfortunately, I have all the *-dev packages I need. Like somebody else said, it's a different problem. Linking the file worked for me. Cheers On 13 December 2011 02:43, Brandon Allbery allber...@gmail.com wrote: On Mon, Dec 12, 2011 at 19:22, Ian-Woo Kim ianwoo...@gmail.com wrote: A workaround is to make a symbolic link to libstdc++.so.6 with the name of libstdc++.so in /usr/lib or /usr/local/lib or other dynamic library path like the following. ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so This is an indication that you have not installed your distribution's -dev package for the library in question. You should do so instead of making the symlink manually. (cabal has no support for this kind of thing) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: Anansi 0.4.2 (literate programming pre-processor)
On Tue, Dec 13, 2011 at 03:39, Magnus Therning mag...@therning.org wrote: 1. What to call files? I understand (C)WEB suggests using .w, and that noweb uses .nw, what should I call anansi files? I usually use .anansi, but it doesn't matter. You can use whatever extensions you like, or even none at all. 2. Combining anansi and pandoc works quite well for HTML, but it fails miserably when trying to use the generated LaTeX: markdown2pdf: ! LaTeX Error: Command \guillemotleft unavailable in encoding OT1. Is there any good way to get around that? The LaTeX loom is designed to output basic markup that can be turned into a PDF with minimum fuss. It probably won't work as-is for more advanced cases, such as when a user wants to use custom templates, or has to inter-operate with pseudo-LaTeX parsers like Pandoc. You could try copying the LaTeX loom into your own code, modifying it to generate the custom output format you want, and then running it as a #!runhaskell script. 3. Is there any editor support for anansi, syntax highlihgting etc? Not that I know of. Note that Anansi's syntax itself is very minimal, so what you need is an editor that can support formatting a file using multiple syntaxes. I don't know enough about editor modification to figure out which editors support such a feature, or how to enable it. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On 12 December 2011 22:39, Antoine Latter aslat...@gmail.com wrote: But now they look as if they are of equal importance with the other class methods, which is not really true. Maybe, but something like this is best fixed by improving documentation, not by shuffling things around and needlessly breaking APIs. I also agree that if an Alternative instance doesn't make sense it should be removed. The current documentation is indeed very terse indeed. In particular it needs a section on the pitfalls that users are likely to run into (like infinite loops). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Off The Beaten Track: Call for Participation
Off The Beaten Track: Underrepresented Problems for Programming Language Researchers http://www.cs.princeton.edu/~dpw/obt/ A Workshop Co-located with POPL 2012 Philadelphia, USA January 28, 2012 Come and join us for OBT -- we have a great program filled with a diverse set of problems and ideas for programming language researchers. And at the end of the day, we will have an open mic session to discuss directions for the PL community. Our program is now up here: http://www.cs.princeton.edu/~dpw/obt/obt_program.html And you can register here: https://regmaster3.com/2012conf/POPL12/register.php A broader explanation of the workshop goals: Programming language researchers have the principles, tools, algorithms and abstractions to solve all kinds of problems, in all areas of computer science. However, identifying and evaluating new problems, particularly those that lie outside the typical core PL problems we all know and love, can be a significant challenge. Hence, the goal of this workshop is to identify and discuss problems that do not often show up in our top conferences, but where programming language researchers can make a substantial impact. The hope is that by holding such a forum and associating it directly with a top conference like POPL, we can slowly start to increase the diversity of problems that are studied by PL researchers and that by doing so we will increase the impact that our community has on the world. While many workshops associated with POPL have become more like mini-conferences themselves, this is not the goal for Off the Beaten Track. The workshop will be informal and structured to encourage discussion. It will also be centered around problems and problem areas as opposed to fully-formed solutions. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On Dec 13, 2011, at 3:06 AM, Bryan O'Sullivan wrote: There is absolutely no implication of consuming anything in the definitions of many or some. This is how they happen to behave when used in the context of some parsing libraries, but that's all. If many or some always go into an infinite loop for some Alternative instance, then I suspect that the instance itself is either broken or shouldn't exist. Yes of course, so I suppose my point was that when I thought about them in this way their purpose made sense for the first time. :-) Cheers, Greg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On Dec 13, 2011, at 5:09 AM, Bryan O'Sullivan wrote: Correct. And your example of some (Just 1) inflooping was not a counterargument, but rather an illustration that perhaps some people (and I'm not trying to imply you here, don't worry) don't understand what some and many are supposed to do. But if you can't determine whether you can use certain methods of a typeclass without first knowing more about what type you are working with, then that breaks the abstraction since you can no longer treat a typeclass as a promise that given set of methods can be applied to a type. Cheers, Greg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On Dec 13, 2011, at 5:09 AM, Bryan O'Sullivan wrote: Correct. And your example of some (Just 1) inflooping was not a counterargument, but rather an illustration that perhaps some people (and I'm not trying to imply you here, don't worry) don't understand what some and many are supposed to do. But does it really make sense to have class methods with the property that they are undefined on all but a special value of a type? It seems extremely silly to me to keep these two methods in the class and to get around this problem by adding documentation that essentially says, Don't use these methods because they are not actually defined in general. Cheers, Greg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On Dec 14, 2011, at 8:38 AM, Thomas Schilling wrote: On 12 December 2011 22:39, Antoine Latter aslat...@gmail.com wrote: But now they look as if they are of equal importance with the other class methods, which is not really true. Maybe, but something like this is best fixed by improving documentation, not by shuffling things around and needlessly breaking APIs. I also agree that if an Alternative instance doesn't make sense it should be removed. The current documentation is indeed very terse indeed. In particular it needs a section on the pitfalls that users are likely to run into (like infinite loops). It seems that if we go down this route, though, then what we really need is a big, bold warning at the top of the Alternative class saying something like, Do *not* implement this class for your type unless you *really* know what you are doing, which will probably only true if you are writing a parser. If you fail to heed this advice, then many and some will almost assuredly be broken for your type, which will cause code using it to have infinite loops. Cheers, Greg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On Dec 13, 2011, at 3:32 AM, Bryan O'Sullivan wrote: Don't be silly. The purpose of some and many is to be used with combinators that are expected to fail sometimes. If you use them with combinators that always succeed, of course you're going to get an infinite loop. Yes, but how can someone using a typeclass *know* whether a type has values that will always succeed? Apparently the confusion here lies with the fact that the documentation for some and many are too terse for their behaviour to be easily understood. That's a whole different category of problem than ban them!. Nobody has been calling for them to be banned at all --- or at least, I haven't, and I am the one who has started the thread. :-) What we (if I may be so bold as to use the royal we here :-) ) would like would be for these methods to be moved into a separate class. This way users of the classes will know whether their type has well-defined instance for some and many or not. Or, alternatively, we could add documentation making it clear that one should *only* make a type be an instance of Applicative *if* all values of that type will eventually fail in combination, thus ensuring that some and many will always be well defined. Thus, in particular, Maybe would no longer be a well-formed instance of this type, though we might decide to keep it around anyway in order to avoid breaking old code. Cheers, Greg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking program written in haskell
Hi, Ivan, I modified hxournal. New source code is now on github repository. https://www.github.com/wavewave/hxournal Now it has a very rudimentary config file. The config file should be located at $HOME/.hxournal Sample configuration file is hxournal.conf.sample in hxournal. There you can change the name of your X11 device. Current default is Core Pointer for core mouse event, stylus for wacom pen, eraser for wacom eraser. If you look at the message when hxournal start, you will notice what device name your X11 uses. If they are different from the default setup, then please change .hxournal file according to that. I implemented now Use XInput menu in Options menu. So once you toggle it, you can choose whether you use wacom input or core mouse pointer input. Default starting value of it is also set as xinput variable in configuration file (true or false value) If you can test this and report to me, I will appreciate it very much. It will be hxournal ver 0.5.1 if successful. I started hxournal webpage on http://ianwookim.org/hxournal and hxournal dev wiki page on github page. From now on, the discussion about this development will happen there. Thank you . best, Ian-Woo Kim On Tue, Dec 13, 2011 at 2:42 PM, Ian-Woo Kim ianwoo...@gmail.com wrote: Hi, Ivan, Thank you very much for testing. Yes, I need to have many testers. For your problem, first, please send me the console output of hxournal when you start the application. I guess its stylus name problem in X11 setting. Currently, the detection of wacom pen in hxournal is by checking a xinput device which is named as stylus. (as defined in Xorg.conf in /etc/X11/) So you need to change X11 name to stylus or modify line 23 of the source code csrc/c_initdevice.c . I am going to modify this soon. (not yet figured out how to detect the tablet generally, so I am thinking of making a configuration file for hxournal which has an information of the device. ) It has another problem that it always connects to wacom pen if you have wacom tablet, so mouse input is ignored. I need to enable user to choose mouse/wacom input. I released it rather early for getting some attention of interested people. Let me notify you when modifying the code. Thank you again for your interest. Ian-Woo On Tue, Dec 13, 2011 at 8:03 AM, Ivan Perez ivanperezdoming...@gmail.com wrote: In other news, the program runs, but I can't draw anything. I tried it with a wacom and a mouse. Ian-Woo, let me know if you need me to run some tests or to try a new version before you release it. As a fan of xournal, I'd be glad to do so. Cheers, Ivan. On 13 December 2011 14:00, Ivan Perez ivanperezdoming...@gmail.com wrote: Unfortunately, I have all the *-dev packages I need. Like somebody else said, it's a different problem. Linking the file worked for me. Cheers On 13 December 2011 02:43, Brandon Allbery allber...@gmail.com wrote: On Mon, Dec 12, 2011 at 19:22, Ian-Woo Kim ianwoo...@gmail.com wrote: A workaround is to make a symbolic link to libstdc++.so.6 with the name of libstdc++.so in /usr/lib or /usr/local/lib or other dynamic library path like the following. ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so This is an indication that you have not installed your distribution's -dev package for the library in question. You should do so instead of making the symlink manually. (cabal has no support for this kind of thing) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Splitting off many/some from Alternative
On 14 December 2011 17:08, Gregory Crosswhite gcrosswh...@gmail.com wrote: On Dec 13, 2011, at 5:09 AM, Bryan O'Sullivan wrote: Correct. And your example of some (Just 1) inflooping was not a counterargument, but rather an illustration that perhaps some people (and I'm not trying to imply you here, don't worry) don't understand what some and many are supposed to do. But if you can't determine whether you can use certain methods of a typeclass without first knowing more about what type you are working with, then that breaks the abstraction since you can no longer treat a typeclass as a promise that given set of methods can be applied to a type. Doesn't this already apply to much of Monadic code? Apart from some basic combinators in Control.Monad or the definitions of monad transformers, how much of what you write in do-blocks is applicable to some generic Monad instance as opposed to a specific Monad? -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe