News aggregator

QuickCheck failures with new 'tar' release...

libraries list - Thu, 07/09/2015 - 10:26pm
I'm not sure if there's a more appropriate venue to bring this up; the package doesn't seem to have any sort of explicit issue tracker. On the NixOS build servers, we're seeing across-the-board failures for the 0.4.2.0 release of the 'tar' library, specifically, two properties that were added in the latest release. It looks to me like prop_lookup is fundamentally broken---it falls over in the face of a lookup for 'a/b' in a list of entries that includes 'a/b/c/d', because while the library lookup function returns a match including the remainder of the path as a result, the Data.List.lookup that it's comparing against returns nothing. I don't see a way for the test as it is constituted to work reliably. I'm going to guess that prop_valid suffers from a similar issue. Either way, it would be nice if they could either be corrected, or diked out until that happens. Mike.
Categories: Offsite Discussion

First call to putStr takes far more time thansubsequent calls

haskell-cafe - Thu, 07/09/2015 - 9:17pm
This is a simplified version of an issue I'm running into when timing some functions. In this example, the first putStr inside the replicateM_ takes far longer than subsequent putStrs. If I add in a putStr at the top (the commented line), each iteration takes the same. (Though I presume I just shifted the long execution to the putStr on top). The same thing happens on the first iterations of a function when I need to evaluate some state, or deepseq some value. putStr was just a simpler version that still showed the same issue. Relevant code: http://lpaste.net/136250 What's going on here? Thanks! import Control.Monadimport Data.Time.Clock main :: IO ()main = do -- putStr "" replicateM_ 5 $ do t1 <- getCurrentTime putStr "" t2 <- getCurrentTime print . round $ 1000 * 1000 * diffUTCTime t2 t1 {- Sample output: 49 1 1 1 2 -} _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listi
Categories: Offsite Discussion

darcs 2.10.1 release

haskell-cafe - Thu, 07/09/2015 - 6:04pm
Hi all, The darcs team is pleased to announce the release of darcs 2.10.1 ! # Downloading # The easiest way to install darcs 2.10.1 from source is by first installing the Haskell Platform (http://www.haskell.org/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/branch-2.10 # What's new in 2.10.1 (since 2.10.0) # - generalized doFastZip for darcsden support - 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) - fixed the following bugs: - issue2449: test harness/shelly: need to h
Categories: Offsite Discussion

Should ByteString.Lazy, Text.Lazy be deprecated?

Haskell on Reddit - Thu, 07/09/2015 - 6:01pm

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]
Categories: Incoming News

Darcs: darcs 2.10.1 release

Planet Haskell - Thu, 07/09/2015 - 11:10am
Hi all,

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)
Feedback If you have an issue with darcs 2.10.1, you can report it on http://bugs.darcs.net/ . You can also report bugs by email to bugs@darcs.net, or come to #darcs on irc.freenode.net.
Categories: Offsite Blogs

Arrow alternative to WAI? Arrow interface for web development?

Haskell on Reddit - Thu, 07/09/2015 - 9:52am

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]
Categories: Incoming News

What's a good editor for Haskell?

Haskell on Reddit - Thu, 07/09/2015 - 1:33am

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?

Thanks!

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]
Categories: Incoming News

tinybrain.blog.de/2015/07/08/the-evil-of-mailing-list-removals-20645305/

haskell-cafe - Wed, 07/08/2015 - 11:04pm
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

They scrubbed my link??

haskell-cafe - Wed, 07/08/2015 - 11:03pm
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

The evil of "mailing list removals" - andMicrosoft-sponsored s**t ^^

haskell-cafe - Wed, 07/08/2015 - 10:58pm
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

List Moderation

haskell-cafe - Wed, 07/08/2015 - 10:14pm
Stefan Reich has been removed as a member from this list due to a stream of unapologetically off-topic posts. Best, Gershom
Categories: Offsite Discussion

The Internet is insane

haskell-cafe - Wed, 07/08/2015 - 9:53pm
They thumb up the shit and destroy the good stuff. I am really, seriously, interested how anyone can even try to explain how JavaX is supposedly worse (??) than Java. Cheers _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Announcing: monadic FRP using stm

haskell-cafe - Wed, 07/08/2015 - 7:54pm
Hi Haskellers, I know there are already a lot of FRP libraries out there, but still. This is my take on it. It's a very simple library. There are portable Signals that are basically TVars with some update Notifiers. Then you can combine them using a continuation like monad. Because you have a Monad and not only Applicative it's very intuitive and powerful. Check it out. github: https://github.com/yokto/Updater hackage: https://hackage.haskell.org/package/Updater Be warned though. There are probably still some bugs around, but the basics seem to work and there is an example program. Silvio
Categories: Offsite Discussion

Monoid theory for product/sum types

Haskell on Reddit - Wed, 07/08/2015 - 7:21pm

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 with

ProductMonoid = (*, (,), ()) 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]
Categories: Incoming News

Thinking differently about imperative code after a year of Haskell

Haskell on Reddit - Wed, 07/08/2015 - 6:52pm

A little over a year ago I started learning Haskell. There were some touch and go moments where I almost gave the language up. Now I find it difficult to write other code. At work the only code I write is JavaScript (shudder) so Haskell is largely a hobby.

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 through

EitherT 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]
Categories: Incoming News