These types seem to have become obsolete by better solutions such as streaming libraries (conduits, pipes, etc).
These types contribute to a proliferation of string/text types ("Haskell has 5 string types?!").
This proliferation often requires tedious conversions between strict and lazy variants of the types (e.g: Data.Binary expects lazy ByteStrings, everything else in my program uses strict ByteStrings).
They also encourage use of lazy I/O, as pure lazy streams of these types are not that useful or common.submitted by Peaker
[link] [103 comments]
The darcs team is pleased to announce the release of darcs 2.10.1 !
DownloadingThe easiest way to install darcs 2.10.1 from source is by first installing the Haskell Platform (http://www.haskell.org/<wbr></wbr>platform). If you have installed the Haskell Platform or cabal-install, you can install this release by doing:
$ cabal update
$ cabal install darcs-2.10.1
Alternatively, you can download the tarball from http://darcs.net/releases/darcs-2.10.1.tar.gz and build it by hand as explained in the README file.
The 2.10 branch is also available as a darcs repository from http://darcs.net/releases/<wbr></wbr>branch-2.10
What's new in darcs 2.10.1 (since darcs 2.10.0)
- support terminfo 0.4, network 2.6, zlib 0.6, quickcheck 2.8 and attoparsec 0.13
- errorDoc now prints a stack trace (if profiling was enabled) (Ben Franksen)
- beautified error messages for command line and default files (Ben Franksen)
- generalized doFastZip for darcsden support
- fixed the following bugs:
- issue2449: test harness/shelly: need to handle mis-encoded/binary data (Ganesh Sittampalam)
- issue2423: diff only respecting --diff-command when a diff.exe is present (Alain91)
- issue2447: get contents of deleted file (Ben Franksen)
- issue2307: add information about 'darcs help manpage' and 'darcs help markdown' (Dan Frumin)
- issue2461: darcs log --repo=remoterepo creates and populates _darcs (Ben Franksen)
- issue2459: cloning remote repo fails to use packs if cache is on a different partition (Ben Franksen)
I'm willing to do some experimentation with Arrows. I would like to define some REST services using Arrow interface.
I did not find any library providing Arrow interface to create REST services. I think the root is that WAI is monadic.
Is there any library trying to use Arrow interface for web development?submitted by evohunz
[link] [16 comments]
I'm using Sublime Text 2 right now and I'm constantly getting errors due to indentation. Is there any editor that automatically takes care of indentation for you?
Edit: Thank you all for the suggestions! I'm going to try each one for a bit and then see which one better suits me.submitted by DarkSkyKnight
[link] [36 comments]
This page mentions using an SMT solver for type-level naturals, but I've never SMT solvers discussed in the context of sums and products.
Either and (,) form commutative monoids withProductMonoid = (*, (,), ()) SumMonoid = (*, Either, Void)
but as far as the type checker is concerned, the type equalities ((a,b), c) ~ (a, (b,c)), and Either (Either a b) c ~ Either a (Either b c) don't hold. If they did, we'd have a really elegant way of constructing extensible data types, and we'd save a whole bunch fiddling around with constructors.
This is just blue-sky thinking on my part, but has anybody else thought of this? Has anyone ever tried to implement it? Are there any serious impediments? I imagine the runtime memory layout would be an issue, especially in the presence of commutativity.submitted by ForTheFunctionGod
[link] [6 comments]
I recently wrote my first serious Haskell program (a bot of sorts). It was also a big foray into learning Monad Transformers. With the exception of a handful of pure functions, the code mostly looks imperative. It's a series of sequential API calls executed throughEitherT e (StateT s (ReaderT h IO)) a
The bot works in a loop within IterT. It combines an mplus check of an MVar for a termination command along with a forever of the primary function.
Even though the code is largely strict and executed sequentially, I realised that the transformer stack lets me reason about my code in a way I never could in a language like Java or Python.
- When I wanted to encapsulate non-termination, I did it in an IterT
- When I needed to include a global constant (HTTP handler) I included it in a ReaderT
- When I needed to keep track of what the bot was doing I included it in a StateT
Then when I wanted to execute two API calls concurrently/asynchronously my transformer stack forced me to consider some things - what do I do about these two states that exist simultaneously? How do I handle an exception in only one thread? What do I do about the logs being generated?
Now when I write imperative code I lack those abstractions. If I make an asynchronous request there's no compiler telling me that I have just created two states. There's no pattern matching an Either for my exceptions. Where as each Monad in the stack extends me some imperative functionality. In that way each one explicitly tells me what functionality I've added.
But the way I think about imperative code has changed. It's no longer just a bunch of mutable objects being thrown around. I explicitly think about what it's doing. I often write out Haskell style type signatures in pseudocode in my planning. I separate out "pure" functions that don't mutate anything. I separate out different types of mutations based on what it is they are actually doing.
Funnily enough I could have written my bot faster in NodeJS, Python or even Java. I would have been done a lot sooner but I wouldn't have felt as secure. I wanted something that would crash gracefully, that would recover from errors and reverse actions it was in the middle of.
Haskell is fast becoming my favourite imperative language.submitted by TheCriticalSkeptic
[link] [54 comments]