News aggregator

Proposal: Add // for Data.Sequence

libraries list - Mon, 05/30/2016 - 2:21pm
BACKGROUND ---------- Data.Array provides (//) for incremental array updates. Data.Sequence lacks this useful functionality. SCOPE ----- Doing this efficiently may require that Data.Sequence access Data.IntMap. (It currently does not.) David Feuer commented: We may need to add some more splitting functions to Data.IntMap, if it supports them, but we probably want to do so anyway to match up with Data.Map. SOLUTIONS ----------- David Feuer offered the following implementation sketch. (See https://github.com/haskell/containers/issues/262) Collect all requested changes into an IntMap, then use something similar to Data.Sequence.splitMap with Data.IntMap.split to spread them through the tree. David Feuer commented: splitMap itself is overkill, because we'll likely be able to preserve whole subtrees. WHAT MIGHT BREAK ---------------- No anticipated breakage.
Categories: Offsite Discussion

configurable mapping between data declarations andgiven XML schema?

haskell-cafe - Mon, 05/30/2016 - 11:04am
Dear Cafe, I have a legacy XML schema, and some Haskell data declarations. I want to map bidirectionally between XML documents and data. I absolutely cannot change the schema. I could change the data declarations, but it would not help much, since I don't think there is any form of declaring data that would allow me to derive the transformations generically. So, I have a mess of ad-hoc transformations. What could be done about this? I think I need "generic with customization". More detail: https://github.com/jwaldmann/haskell-tpdb/issues/16 Comments appreciated. - J.W.
Categories: Offsite Discussion

Discussion: Add total indexing function to Data.Sequence

libraries list - Sun, 05/29/2016 - 10:21pm
Data.Sequence offers index :: Seq a -> Int -> a which throws an error if the index is out of range. I'd like to add something like indexMay :: Seq a -> Int -> Maybe a Aside from the safety factor, indexMay would offer a way to ensure the indexing occurs at a particular time. Much like Data.Vector.indexM, this can help prevent memory leaks. In fact, an analogue of indexM can be implemented in terms of indexMay: indexM :: Applicative m => Seq a -> Int -> m a indexM xs i = case xs `indexMay` i of Nothing -> error "indexM: index out of range" Just x -> pure x
Categories: Offsite Discussion

Proposal: Add insertAt to Data.Sequence

libraries list - Sun, 05/29/2016 - 9:32pm
I've come up with an implementation of insertAt :: Int -> a -> Seq a -> Seq a
Categories: Offsite Discussion

JSON parser that returns the rest of the string thatwas not used

haskell-cafe - Sun, 05/29/2016 - 6:09pm
As someone who spent many years putting data in S-expression format, it seems natural to me to write multiple S-expressions (or JSON objects) to a file, and expect a reader to be able to read them back one at a time. This seems comparatively uncommon in the JSON world. Accordingly, it looks like the most popular JSON parsing lib, Aeson, doesn't directly provide this functionality. Functions like decode just return a "Maybe a", not the left-over input, meaning that you would need to somehow split up your multi-object file before attempting to parse, which is annoying and error prone. It looks like maybe you can get Aeson to do what I want by dropping down to the attoparsec layer and messing with IResult. But is there a better way to do this? Would this be a good convenience routine to add to aeson in a PR? I.e. would anyone else use this? Thanks, -Ryan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/h
Categories: Offsite Discussion

Testing for different dependency versions?

haskell-cafe - Sun, 05/29/2016 - 5:33am
Hi, I was wondering: what is the most practical way to go about testing or otherwise determining if your packaged library works with other dependency versions? E.g., cabal init specified base 4.6 because that is what happens to be installed on my Debian Jessie system, but that wouldn't even build on hackage.
Categories: Offsite Discussion

Quantum Programming EDSLs other than Quipper

haskell-cafe - Sat, 05/28/2016 - 4:04pm
Hi all, Quipper [1] is a well-known library that provides an EDSL for writing and simulating quantum algorithms in Haskell. I was wondering if there was any other attempt to design an EDSL in Haskell to express quantum algorithms. In particular, Quipper is not able to statically ensure that the algorithm written is physically meaningful, as one could violate the "non-cloning property", for example (a qubit cannot be copied, for those who do not speak quantumly). Violations like this are detected at runtime when simulating the algorithm or when producing the corresponding circuit as output. Authors of Quipper already said that some of those properties could be possible to check “if Haskell had linear types”. The point is that Haskell's support for dependently typed programming has grown quite a lot in the last years, and I think that, at least theoretically, something better can now be achieved. So do anyone know any more recent attempt to express quantum computations in an Haskell EDSL that levera
Categories: Offsite Discussion

Reminder: Functional High-Performance Computing 2016

haskell-cafe - Sat, 05/28/2016 - 3:58pm
Dear colleagues, A reminder of the approaching paper deadline (10th June) for FHPC 2016 ... ====================================================================== CALL FOR PAPERS FHPC 2016 The 5th ACM SIGPLAN Workshop on Functional High-Performance Computing Nara, Japan September 22, 2016 https://sites.google.com/site/fhpcworkshops/ Co-located with the International Conference on Functional Programming (ICFP 2016) Submission Deadline: Friday, 10 June, 2016 (anywhere on earth) ====================================================================== The FHPC workshop aims at bringing together researchers exploring uses of functional (or more generally, declarative or high-level) programming technology in application domains where high performance is essential. The aim of the meeting is to enable sharing of results, experien
Categories: Offsite Discussion

Higher order type functions

haskell-cafe - Sat, 05/28/2016 - 1:22am
Hi folks! I'm playing with GHC 8 and have the following type family definend: type family InsertSorted (gt :: k -> k -> Bool) (a :: k) (xs :: [k]) :: [k] where InsertSorted f a '[] = '[a] InsertSorted f a (x ': xs) = If (f a x) (x ': InsertSorted f a xs) (a ': x ': xs) With appropriate type functions, I can evaluate this in GHCi with `:kind!` and it does what I want: λ> :kind! InsertSorted GreaterThan One '[Two, Four] InsertSorted GreaterThan One '[Two, Four] :: [Face] = '['One, 'Two, 'Four] λ> :kind! InsertSorted GreaterThan Queen '[Two, Four] InsertSorted GreaterThan Queen '[Two, Four] :: [Face] = '['Two, 'Four, 'Queen] However, I get an error if I try to use this in a type signature. This code: data Deck (b :: [k]) where Empty :: Deck '[] (:::) :: CardT s f -> Deck xs -> Deck (InsertSorted GreaterThan '(s, f) xs) gives me this error: • The type family ‘GreaterThan’ should have 2 arguments, but has been given none • In the definition of data con
Categories: Offsite Discussion

Announce: Haskell Platform 8.0.1

General haskell list - Fri, 05/27/2016 - 8:14pm
On behalf of the Haskell Platform team, I'm happy to announce the release of Haskell Platform 8.0.1 Now available at https://www.haskell.org/platform/ This platform includes features initially planned in the "Improving the 'Get Haskell Experience'" proposal of June 2015. [1] * Minimal as well as Full distributions. The minimal distribution only includes GHC core libraries as well as additional tools. This is now the recommended distribution. The Full distribution remains an option for those who want a one-step installer with the broader set of platform libraries preinstalled. * Inclusion of the Stack tool for developing Haskell projects [2] Other highlights of this release include the following * The new cabal 1.24 including the great "new-build" tech preview of nix-like build dependency management [3] * On windows, a cabal/msys setup that allows packages such as "network" to build "out of the box". (almost*) * At long last, prebuilt Linux 32 bit platform installers Changes to Conte
Categories: Incoming News

Proposal: Add `maxOn` and `minOn` functions to Data.Ord

libraries list - Fri, 05/27/2016 - 7:51pm
I think these are useful in general, and that they would make a good addition to `Data.Ord`. The names are inspired by `sortOn`. Definitions: ``` minOn :: Ord b => (a -> b) -> a -> a -> a minOn f x y = case comparing f x y of LT -> x _ -> y maxOn :: Ord b => (a -> b) -> a -> a -> a maxOn f x y = case comparing f x y of GT -> x _ -> y ``` These don't need to be the exact definitions, but they convey the semantics I'm looking for. _______________________________________________ Libraries mailing list Libraries< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Categories: Offsite Discussion

read "2" in a "void" context?

haskell-cafe - Fri, 05/27/2016 - 7:28pm
Hi fellow Haskellers! If I bring up ghci and evaluate `read 2` I get the error "Prelude.read: no parse" GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help Prelude> read "2" *** Exception: Prelude.read: no parse Exactly how is this message coming about? I understand that `read` needs a return type in order to determine which type class instance to run. So, in this case, which type is `read` being asked to return? Thanks, Erik _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Munich Haskell Meeting,2016-05-30 < at > 19:30 Max Emanuel Brauerei

haskell-cafe - Fri, 05/27/2016 - 2:05pm
Dear all, Next week, our monthly Munich Haskell Meeting will take place again on Monday, May 30 at *Max Emanuel Brauerei* at 19h30. For details see here: http://chneukirchen.github.io/haskell-munich.de/dates.html **Please note the changed location!** If you plan to join, please add yourself *quickly* to this dudle so we can reserve enough seats! It is OK to add yourself to the dudle anonymously or pseudonymously. https://dudle.inf.tu-dresden.de/haskell-munich-may-2016/ Everybody is welcome! cu,
Categories: Offsite Discussion

Mobile Development

haskell-cafe - Fri, 05/27/2016 - 1:42pm
I'm wondering if anyone has any experience they can share, know of any blog posts or anything else documenting the use of Haskell when developing a mobile application. Ideally, I would like something along the lines of having a native UI, a language bridge, and use Haskell for the core logic. My main focus would be getting this to work on Android and iOS. If this would also work on Blackberry and Windows Phone it would be a plus. I have successfully done this using C++ in place of Haskell in the past, but would really be interested in getting something working using Haskell. Thanks, Justin _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Hackage (partially) down?

haskell-cafe - Fri, 05/27/2016 - 5:40am
Hi all, I'm getting Error 503 Connection timed out Connection timed out Guru Mediation: Details: cache-ams4123-AMS 1464323906 827600523 Varnish cache server when trying to browse Hackage this morning. Anyone else having the same problem? (downforeveryoneorjustme.com says that "it's just me", so I'm guessing this is some sort of CDN issue?) Regards,
Categories: Offsite Discussion

Pattern synonyms and GADTs in GHC 8.0.1

glasgow-user - Thu, 05/26/2016 - 4:27pm
I have a problem where a pattern synonym doesn't provide the expected type refinement in GHC 8.0.1. This gives the error • No instance for (Eq a) arising from a pattern Possible fix: add (Eq a) to the context of the type signature for: simplifyP :: Exp a -> Exp a • In the pattern: AddP a (NumP 0) In an equation for ‘simplifyP’: simplifyP (AddP a (NumP 0)) = a If I remove the type signature for `AddP`, the code goes through. Unfortunately, in my real code I need the type signature in order to resolve overloading. GHC 7.10 didn't have this problem. Is this a bug? / Emil
Categories: Offsite Discussion

CFP: Workshop on Type-driven Development (TyDe '16)

General haskell list - Thu, 05/26/2016 - 12:13pm
-------------------------------------------------------------------------------- FINAL CALL FOR PAPERS 1st Type-Driven Development (TyDe '16) A Workshop on Dependently Typed and Generic Programming 18 September, Nara, Japan -------------------------------------------------------------------------------- The deadline of the inaugural edition of TyDe is approaching rapidly. Please submit full papers before June 10th and abstracts before June 24th. # Goals of the workshop The workshop on Type-Driven Development aims to show how static type information may be used effectively in the development of computer programs. The workshop, co-located with ICFP, unifies two workshops: the Workshop on Dependently Typed Programming and the Workshop on Generic Programming. These two research areas have a rich history and bridge both theory and practice. Novel techniques explored by both commun
Categories: Incoming News

Example of FunBind without wrapping AbsBind?

haskell-cafe - Wed, 05/25/2016 - 5:41pm
I was playing with the AST's typechecked tree, and found some examples of the subject, but can't tell what is the rule for that to occur. It was a local binding. Do you have a hint and/or a minimal example? Thanks! Robin _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Cannot install 8.0.1 from bindist

glasgow-user - Wed, 05/25/2016 - 12:55pm
Trying to install ghc-8.0.1-x86_64-centos67-linux.tar.xz with: ./configure --prefix={prefix} make install-strip gives me an error. The tail of the log is: Registering ghc-8.0.1... for f in '{prefix}/lib/ghc-8.0.1/package.conf.d'/*; do create () { touch "$1" && chmod 644 "$1" ; } && create "$f"; done /usr/bin/install -c -m 755 -d "{prefix}/bin" for i in utils/hp2ps/dist/build/tmp/hp2ps; do \ /usr/bin/install -c -m 755 -s $i "{prefix}/bin" ; \ done /usr/bin/install -c -m 755 -d "{prefix}/lib/ghc-8.0.1/bin" for i in inplace/lib/bin/ghc-split; do \ /usr/bin/install -c -m 755 $i "{prefix}/lib/ghc-8.0.1/bin"; \ done /usr/bin/install -c -m 755 -d "{prefix}/share/doc/ghc-8.0.1" /usr/bin/install -c -m 755 -d "{prefix}/share/doc/ghc-8.0.1/html" /usr/bin/install -c -m 644 docs/index.html "{prefix}/share/doc/ghc-8.0.1/html" /usr/bin/install -c -m 755 -d "{prefix}/share/doc/ghc-8.0.1/html/libraries" for i in libraries/dist-haddock/*; do \ /usr/bin/install -c -m 644 $i "{prefix}/share/doc/ghc-8.0.1/htm
Categories: Offsite Discussion

1st CfP: IFL 2016 (28th Symposium on Implementation and Application of Functional Languages)

General haskell list - Tue, 05/24/2016 - 8:13pm
Hello, Please, find below the first call for papers for IFL 2016. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- IFL 2016 - Call for papers 28th SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES - IFL 2016 KU Leuven, Belgium In cooperation with ACM SIGPLAN August 31 - September 2, 2016 https://dtai.cs.kuleuven.be/events/ifl2016/ Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2016 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Peer-review Following the IFL tradition, IFL 2016 will use a post-symposium review process
Categories: Incoming News