News aggregator

Applying a Constraint to a Proxy'd type

haskell-cafe - Sun, 05/08/2016 - 1:15pm
I'm not sure if it's possible (and I have an alternate method of doing this so it isn't strictly speaking _necessary_, but would make the code cleaner if I can), but I would like to convert a "value" of kind (k -> Constraint) into one of kind (Proxy k -> Constraint). I can achieve this using a type family (note: I've also made this polymorphic in terms of the Proxy type used, but that isn't necessary): which has the problem that it can't be partially applied (which I also need). This can be wrapped up in a typeclass: The problem with this is that if I try and use it somewhere that - having already a type of kind (c :: * -> Constraint) from the environment - that expects a function of type (forall a. (c a) => a -> b) with a fixed "b" value, then trying to use something like this function prevents it from working (for the purposes of argument, assume the old specification of Num that had an Eq superclass; this is the way I can produce the smallest example): The resulting error message is: "Could not de
Categories: Offsite Discussion

I have a question

haskell-cafe - Sat, 05/07/2016 - 1:29am
Hi I don’t want to receive this mail anymore. what should do? thanks _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

The maths behind the Fastest Fibb In The West.

haskell-cafe - Sat, 05/07/2016 - 12:46am
I've been working on a project that needs a good fibonacci generator, and I'm to the point where can now improve upon this one: https://wiki.haskell.org/The_Fibonacci_sequence#Fastest_Fib_in_the_West thanks to this guy: https://groups.google.com/forum/#!topic/haskell-cafe/HUgbAUCvCp4 He suggested breaking up a guard into two diffeent functions, which I can do, but I don't know what to call them because I don't know why the operations are different. I'm referring to this section: fib' (f, g) p | p = (f*(f+2*g), f^2 + g^2) | otherwise = (f^2+g^2, g*(2*f-g)) I'd like to know the reason why each guard does two entirely different things, so I know what to call the functions when I seperate them out. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Storing big datasets

haskell-cafe - Fri, 05/06/2016 - 9:28pm
Hi! I'm using ACID package as main database -- it's simple and... ACID (which is cool of course). So now I need to store up to ~30GB of data in a single data structure (!) that will be constantly updated (some kind of a huge tree set). Here's a question -- how to operate that big structure? 1. It doesn't even fit in RAM 2. It should be updated atomically and frequently (every 10 seconds up to 500 elements out of 10^7). 3. What structures should I use? I'd like to store up to 10^6~10^7 some simple elements there too, that will be gigabytes of data. So it seems to me I can't use Data.Set. Thanks for any ideas!
Categories: Offsite Discussion

Code critique request

haskell-cafe - Fri, 05/06/2016 - 7:29pm
I've got this fizzbuzz project I am using for a blog series, among other things. In this version, the fizzbuzz function is fed from a Fibonacci generator. I'm particularly concerned with the efficiency of the Fibonacci generator, but all scrutiny is welcomed. I'll included a link to the entire project, but below are the parts I think would be sufficient to spot trouble with how I am generating Fibonacci numbers.
Categories: Offsite Discussion

GHC.Prim: Resizable Multidimensional array

haskell-cafe - Fri, 05/06/2016 - 1:52pm
I'm trying to create a resizable multidimensional array using the primitive array stuff in GHC.Prim. I see that the only resizable array is the ByteArray#, but the only array that supports multidimensionality is the ArrayArray# as far as I can tell. I have groups of 4 Double#s that I want to have a resizable array of, so only really the "first dimension" needs to be resizable. I was thinking if there was a way to get the pointer of a SmallArray# as an Addr# I could use the ability of ByteArray#s to store Addr#s. The other option I was considering was to simply have a mapping similar to the ones provided by Data.Ix that maps pairs of numbers to a single index, and in that way use a single ByteArray# to store everything. However, because this will be a fairly large array it seems like it is a much better idea to avoid allocating and reallocating that humongous chunk of memory when I can keep it spread out in smaller chunks by storing pointers to smaller arrays in the larger array. But maybe that isn't an imp
Categories: Offsite Discussion

Trouble building library with cabal-install 1.24

haskell-cafe - Fri, 05/06/2016 - 10:40am
I'm trying to use cabal-install 1.24. To start fresh, I removed ~/.cabal and ~/.ghc, and then used the old cabal(-install) executable to do cabal update and cabal install cabal-install. Unfortunately, it seems that cabal-install is building everything except my library! $ cabal --version cabal-install version 1.24.0.0 compiled using version 1.24.0.0 of the Cabal library $ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.3 $ cat cabal.project.local tests: True program-options ghc-options: -Werror $ cabal new-build --enable-test -v Project settings changed, reconfiguring... creating /home/eamybut/néal/creatur/dist-newstyle creating /home/eamybut/néal/creatur/dist-newstyle/cache creating /home/eamybut/.cabal/store/ghc-7.10.3 Reading installed packages... /usr/local/ghc-7.10.3/bin/ghc-pkg dump '--package-db=/home/eamybut/.cabal/store/ghc-7.10.3/package.db' -v0 /usr/local/ghc-7.10.3/bin/ghc --print-libdir -Werror In order, the following will be built: cond-0.4.1.1 (lib:cond)
Categories: Offsite Discussion

RFC: Removing the `-hb` profiling option

glasgow-user - Fri, 05/06/2016 - 10:04am
Hi all, After a bit of rather tedious and frustrating debugging I came to the realisation that the code for the `-hb` profiling option is not thread safe. See https://ghc.haskell.org/trac/ghc/ticket/12019 This gives us an opportunity to simply remove it instead of fixing it. If there is anyone that thinks this future is really useful (ie more useful than the other profiling modes) then I'm willing to fix it. But if noone would miss it. I'd much rather remove it. Thoughts? Erik
Categories: Offsite Discussion

What happened to -optdep option?

glasgow-user - Thu, 05/05/2016 - 8:19pm
Hello! I'm using GHC 7.10.3 after an upgrade. I have the following in my Makefile: depend_mod :: lib/abh ghc -M $(CFLAGS_GHC_0) -dep-makefile -optdepbuild/depend.tmp -dep-suffix "p_" \ $(foreach m, $(MOD_HS) $(PROG_HS), src/$(m).hs) \ $(foreach m, $(MOD_CHS) $(PROG_CHS), build/$(m).hs) ... This used to work. The previous GHC version was 7.8. Now GHC complains: -optdepbuild/depend.tmp: openBinaryFile: does not exist (No such file or directory) This looks like the -optdep argument isn't understood. There is no mention of it in the new/7.10.3 user manual. I don't know any longer what this "-optget" argument does, and it isn't in the documentation any longer. I googled the GHC web site. There it is mentioned that -optdep was deprecated, but almost all of the hits are very outdated (like ten years old). Can soneone tell me, how I should change my Makefile..? Greetings, Volker Wysk
Categories: Offsite Discussion

NFM 2016 - Call for participation

General haskell list - Thu, 05/05/2016 - 2:19pm
******************************************************************** CALL FOR PARTICIPATION The 8th NASA Formal Methods Symposium June 7 - June 9, 2016 McNamara Alumni Center University of Minnesota Minneapolis, MN http://crisys.cs.umn.edu/nfm2016 ******************************************************************** REGISTRATION ... is FREE! All interested individuals, including non-US citizens, are welcome to attend. All participants must register but there is no registration fee. Please register online at http://crisys.cs.umn.edu/nfm2016/REGISTRATION We strongly encourage participants to register early and reserve accommodations. A block of hotel rooms are reserved at The Commons Hotel until May 7, 2016. THEME OF THE SYMPOSIUM The NASA Formal Methods Symposium is a forum to foster collaboration between theoreticians and practitioners from NASA, academia, and the
Categories: Incoming News

Is Haskell IO inherently slower than C?

haskell-cafe - Thu, 05/05/2016 - 2:05am
I'm trying to write a program in Haskell that writes a large file at the end, and it seems like that output alone is taking way longer than it should. I don't understand why Haskell shouldn't be able to write data as quickly as C, so I wrote two test files:
Categories: Offsite Discussion

Cabal confusion. Modules not being exposed stillaccessible for testing.

haskell-cafe - Thu, 05/05/2016 - 12:18am
I use reactive-banana <https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana/reactive-banana.cabal> as an example. My question is how can Reactive.Banana.Internal.Combinators be testable from Reactive.Banana.Test.Plumbing? My misunderstanding is that only modules named in the exposed-modules stanza could be imported. Could someone clear up my misunderstanding? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

PPDP 2016 - Last Call for Papers

General haskell list - Wed, 05/04/2016 - 9:19am
====================================================================== Last call for papers 18th International Symposium on Principles and Practice of Declarative Programming PPDP 2016 Special Issue of Science of Computer Programming (SCP) Edinburgh, UK, September 5-7, 2016 (co-located with LOPSTR and SAS) http://ppdp16.webs.upv.es/ ====================================================================== SUBMISSION DEADLINE: 9 MAY (abstracts) / 16 MAY (papers) ---------------------------------------------------------------------- INVITED SPEAKERS Elvira Albert, Complutense University of Madrid, Spain ---------------------------------------------------------------------- PPDP 2016 is a forum that brings together researchers from the declarative programming communities, including those working in the logic, constraint and functional programming paradigms, but also embracing languages, database languages, and knowledge repres
Categories: Incoming News

ANN: monad-ste-0.1.0.0

haskell-cafe - Wed, 05/04/2016 - 5:09am
hello All, I took the time this evening to clean up some work that came out of a larger project and have made a corresponding release to hackage monad-ste is sibling to ST that provides efficient abortive errors using GHC's exception machinery as well as handy machinery like being a PrimMonad and PrimBase instance! (and take heed, you cannot catch ) hackage: https://hackage.haskell.org/package/monad-ste-0.1.0.0 github: https://github.com/cartazio/monad-ste also thanks Brian Schroeder, Joel Burget and Duncan Coutts for providing invaluable feedback, debugging and the like for this library enjoy! -Carter _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Call for Papers: OCL and Textual Modeling Tools and Textual Model Transformations (OCL 2016) - Submit Your Paper Until July 17, 2016

General haskell list - Wed, 05/04/2016 - 3:10am
(Apologies for duplicates) CALL FOR PAPERS 16th International Workshop on OCL and Textual Modeling Co-located with ACM/IEEE 19th International Conference on Model Driven Engineering Languages and Systems (MODELS 2016) October 2-4, 2016, Saint-Malo, France (TBC) http://oclworkshop.github.io Modeling started out with UML and its precursors as a graphical notation. Such visual representations enable direct intuitive capturing of reality, but some of their features are difficult to formalize and lack the level of precision required to create complete and unambiguous specifications. Limitations of the graphical notations encouraged the development of text-based modeling languages that either integrate with or replace graphical notations for modeling. Typical examples of such languages are OCL, textual MOF, Epsilon, and Alloy. Textual modeling languages have their roots in formal language paradigms like logic, programming and databases. The goal of this w
Categories: Incoming News

Call for Papers: OCL and Textual Modeling Tools and Textual Model Transformations (OCL 2016) - Submit Your Paper Until July 17, 2016

haskell-cafe - Wed, 05/04/2016 - 3:10am
(Apologies for duplicates) CALL FOR PAPERS 16th International Workshop on OCL and Textual Modeling Co-located with ACM/IEEE 19th International Conference on Model Driven Engineering Languages and Systems (MODELS 2016) October 2-4, 2016, Saint-Malo, France (TBC) http://oclworkshop.github.io Modeling started out with UML and its precursors as a graphical notation. Such visual representations enable direct intuitive capturing of reality, but some of their features are difficult to formalize and lack the level of precision required to create complete and unambiguous specifications. Limitations of the graphical notations encouraged the development of text-based modeling languages that either integrate with or replace graphical notations for modeling. Typical examples of such languages are OCL, textual MOF, Epsilon, and Alloy. Textual modeling languages have their roots in formal language paradigms like logic, programming and databases. The goal of this w
Categories: Offsite Discussion

Sponsored: 64% off Code Black Drone with HD Camera

del.icio.us/haskell - Tue, 05/03/2016 - 11:00pm
Our #1 Best-Selling Drone--Meet the Dark Night of the Sky!
Categories: Offsite Blogs

something went wrong

del.icio.us/haskell - Tue, 05/03/2016 - 11:00pm
Categories: Offsite Blogs

Could Haddock export documentation with type familyapplications normalised?

haskell-cafe - Tue, 05/03/2016 - 11:20am
Hi all, I'm working on a library that uses quite a lot of type "magic" (as some would call it), but really it's all just implementation details. The type families are necessary for me to write the code, but an outside understanding of these type families shouldn't be necessary to understand the library. Unfortunately, Haddock does not align with that goal. To give you a feeling for things, take the following types: data Expr (t :: k) data AsHaskell (t :: k) data BaseType = DBInt | DBText type family Col (f :: k -> *) (a :: k) :: * type instance Col Expr (a :: BaseType) = Expr a type instance Col AsHaskell (a :: BaseType) = BaseTypeAsHaskell a type family BaseTypeAsHaskell (bt :: BaseType) :: * where BaseTypeAsHaskell 'DBInt = Int BaseTypeAsHaskell 'DBText = String class Lit (exprType :: k) where lit :: Col AsHaskell exprType -> Expr exprType instance Lit 'DBInt where lit = ... instance Lit 'DBText where lit = ... (I am modelling the interaction with remote relational databases, to provide a li
Categories: Offsite Discussion

Controlling how test data is generated in QuickCheck2

haskell-cafe - Tue, 05/03/2016 - 2:52am
I have a problem similar to this question < http://stackoverflow.com/questions/9977734/controlling-how-test-data-is-generated-in-quickcheck>. Below I will articulate my specifics, the code I am using, and the particular question I have. I have written a fizz-buzz program that uses a Fibonacci sequence as input. I would like to test two things. (1) Does my program emit the correct string given an Int that meets a particular condition. (2) Is my Fibonacci generator generating Fibonacci numbers? The problem I am having is similar to the link above. The range of `Int`s is too large. How do I constrain my tests to say, the first 1000 Fibonacci numbers? Here is code that I think is both adequate and minimal. Please let me know if I need to elaborate. import Data.Numbers.Primes (isPrime) import Test.Hspec (Spec,hspec,describe,it,shouldBe) import Test.Hspec.QuickCheck (prop) qcheck :: Spec qcheck = do describe "QuickCheck test fiz" $ prop "QuickCh
Categories: Offsite Discussion