News aggregator

OAuth2 and OpenID Connect in Haskell

haskell-cafe - Tue, 05/10/2016 - 10:49pm
Hello all, I've written a blog article as an introduction to the Haskell project I've been working on, which may be of interest to some people here. It's an OpenID Connect identity provider. http://broch.io/posts/oauth2-openid-connect-haskell/ I'd really welcome any feedback on other/better ways of doing some of things it talks about. Cheers, Luke.
Categories: Offsite Discussion

Using parallels for fibonacci

haskell-cafe - Tue, 05/10/2016 - 5:39pm
I am trying to efficiently use multicores for my fizzbuzz <https://github.com/mlitchard/swiftfizz> project. My fizzbuzz uses a Fibonacci generator as input, and this is where it can get computationally heavy. I believe I have picked the best algorithm for my project (please correct this if wrong), and now I am trying to use the parallel package <https://hackage.haskell.org/package/parallel-3.2.1.0>. I am not getting any better performance in the sense that if I try to compute the 100th Fibonacci number, it is still computing , using 4 cores, several minutes later. Here is my attempt. Please show me how to use this library right. from src/FizzBuzz.hs fizzBuzzFib :: Integer -> [Text] fizzBuzzFib ub = parMap rdeepseq fizzbuzz $! fibSeq ub from src/FizzFub.hs fibSeq :: Integer -> [Integer] fibSeq ub = withStrategy (parBuffer buffer rdeepseq) $ genericTake ub fibbwhere buffer = 100 fibb :: [Integer] fibb = 0 : 1 : zipWith (+) fibb (tail fibb) _______________________________________________ Haskell-Cafe ma
Categories: Offsite Discussion

Trustworthy Refactoring project: Research AssociatePositions in Refactoring Functional Programs and FormalVerification (for CakeML)

General haskell list - Tue, 05/10/2016 - 4:33pm
Trustworthy Refactoring project: Research Associate Positions in Refactoring Functional Programs and Formal Verification (for CakeML) The Trustworthy Refactoring project at the University of Kent is seeking to recruit postdoc research associates for two 3.5 year positions, to start in September this year. The overall goal of this project is to make a step change in the practice of refactoring by designing and constructing of trustworthy refactoring tools. By this we mean that when refactorings are performed, the tools will provide strong evidence that the refactoring has not changed the behaviour of the code, built on a solid theoretical understanding of the semantics of the language. Our approach will provide different levels of assurance from the (strongest) case of a fully formal proof that a refactoring can be trusted to work on all programs, given some pre-conditions, to other, more generally applicable guarantees, that a refactoring applied to a particular program does not change the behaviour of t
Categories: Incoming News

Summer of Haskell Mentors

General haskell list - Tue, 05/10/2016 - 3:31am
If you are interesting in helping out as a possible mentor for this year's Summer of Haskell, please email me, and include MENTOR in the title. Thank you! -Edward
Categories: Incoming News

origin of my fibonacci test

haskell-cafe - Tue, 05/10/2016 - 12:59am
I have some code that checks to see if a number is a fibonacci number. It's not mine, I got it from somewhere and I need to credit it. I am pretty sure I got it from Stack Exchange but my search for it went nowhere. If this looks familiar to you, or you can tell me better ways to search, please let me know. isFib :: Integer -> Bool isFib n = n == a where (_, a, _) = unFib (1, 1) n unFib :: (Integer, Integer) -> Integer -> (Integer,Integer,Integer) unFib (a, b) n | n < a = (0, 0, 1) | n < e = (2*k, c, d) | otherwise = (2*k + 1, e, f) where (k, c, d) = unFib (fibPlus (a, b) (a, b)) n (e, f) = fibPlus (a, b) (c, d) fibPlus :: (Integer, Integer) -> (Integer, Integer) -> (Integer,Integer) fibPlus (a, b) (c, d) = (bd - (b - a)*(d - c), a*c + bd) where bd = b*d _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Myrtle Software is looking for Haskell developers for exciting graphics/compilers/hardware work

haskell-cafe - Mon, 05/09/2016 - 6:08pm
https://www.myrtlesoftware.com/vacancies/ We're a small software company in Cambridge, UK. We are working on some cool tech for lowering image processing algorithms to efficient hardware designs with a focus on putting these in autonomous vehicles. Our compiler is written completely in Haskell as well as some other tools we've written in house. We are looking to hire some more Haskell talent to help drive things forward. Please ask if you have any questions!
Categories: Offsite Discussion

WST 2016 - First Call for Papers

haskell-cafe - Mon, 05/09/2016 - 3:41pm
========================================================================== WST 2016 - 1st Call for Papers 15th International Workshop on Termination September 5-7, 2016, Obergurgl, Austria http://cl-informatik.uibk.ac.at/events/wst-2016/ ========================================================================== The Workshop on Termination (WST) traditionally brings together, in an informal setting, researchers interested in all aspects of termination, whether this interest be practical or theoretical, primary or derived. The workshop also provides a ground for cross-fertilization of ideas from term rewriting and from the different programming language communities. The friendly atmosphere enables fruitful exchanges leading to joint research and subsequent publications. The event is held as part of CLA 2016 http://cl-informatik.uibk.ac.at/events/cla-2016/ IMPORTANT DATES: * submission June 22, 2016 * n
Categories: Offsite Discussion

suboptimal ghc code generation in IO vs equivalent pure code case

glasgow-user - Mon, 05/09/2016 - 3:23pm
I have a loop which runs millions of times. For some reason I have to run it in the IO monad. I noticed that when I convert the code from pure to IO monad the generated assembly code in essence is almost identical except one difference where it puts a piece of code in a separate block which is making a huge difference in performance (4-6x slower). I want to understand what makes GHC to generate code in this way and if there is anything that can be done at source level (or ghc option) to control that. The pure code looks like this: decomposeChars :: [Char] -> [Char] decomposeChars [] = [] decomposeChars [x] = case NFD.isDecomposable x of True -> decomposeChars (NFD.decomposeChar x) False -> [x] decomposeChars (x : xs) = decomposeChars [x] ++ decomposeChars xs The equivalent IO code is this: decomposeStrIO :: [Char] -> IO [Char] decomposeStrPtr !p = decomposeStrIO where decomposeStrIO
Categories: Offsite Discussion

Problems with function recursion in Haskell

haskell-cafe - Mon, 05/09/2016 - 2:30pm
Hi, I'm new in Haskell and I need help in recursion. That function below is returning "*** Exception: Prelude.head: empty list" and I need resolve that: execNTimes 0 [] = return() execNTimes n xs = if n<=0 || null xs then return() else do si <- getLine let s = words si l = read (s !! 1) :: Int r = read (s !! 2) :: Int if head s=="Q" then do let z = slice l r xs m = foldl lcm 1 z print (m `mod` (toInteger 1000000007)) else do let s1 = update l r xs execNTimes (n-1) s1 execNTimes (n-1) xs Anybody can me help? Thank you, Josenildo Silva
Categories: Offsite Discussion

LPTI'16 Call for Papers

General haskell list - Mon, 05/09/2016 - 11:30am
Call for Papers Workshop on Logic Programming for Type Inference 16-17 October 2016, New York, USA https://ff32.host.cs.st-andrews.ac.uk/lpti16/ Objectives and scope ------------------- Two facts are universally acknowledged: critical software must be subject to formal verification and modern verification tools need to scale and become more user-friendly in order to make more impact in industry. There are two major styles of verification: algorithmic : verification problems are specified in an automated prover, e.g. (constraint) logic programming or SMT solver, and properties of interest are verified by the prover automatically. Such provers can be fast, but their trustworthiness is hard to establish without producing and checking proofs. An alternative is a typeful approach to verification: instead of verifying programs in an external prover, a programmer may record all properties of interest as types of functions in his programs. Thanks to Curry-Howard isomorphism, type inhabitants also play the rol
Categories: Incoming News

CFP: WADT 2016

General haskell list - Mon, 05/09/2016 - 11:13am
CFP: WADT 2016 - 23rd International Workshop on Algebraic Development Techniques Link: http://cs.swan.ac.uk/wadt16/ When Sep 21, 2016 - Sep 24, 2016 Where Gregynog, UK Submission Deadline June 3, 2016 Notification June 17, 2016 Final Version Due July 1, 2016 AIMS AND SCOPE The algebraic approach to system specification encompasses many aspects of the formal design of software systems. Originally born as formal method for reasoning about abstract data types, it now covers new specification frameworks and programming paradigms (such as object-oriented, aspect-oriented, agent-oriented, logic and higher-order functional programming) as well as a wide range of application areas (including information systems, concurrent, distributed and mobile systems). The workshop will provide an opportunity to present recent and ongoing work, to meet colleagues, and to discuss new ideas and future trends. TOPICS OF INTEREST Typical, but not exclusive topics of interest are
Categories: Incoming News

CRV 2016 - The 3rd International Competition on RuntimeVerification

General haskell list - Mon, 05/09/2016 - 10:56am
CRV 2016 The 3rd International Competition on Runtime Verification In Association with COST Action “Runtime Verification beyond Monitoring” held with RV 2016, September 23-30 2016, Madrid, Spain https://rv2016.imag.fr/?page_id=188 CRV 2016 is the 3rd International Competition on Runtime Verification and will be held as part of the 16th International Conference on Runtime Verification. The event will be held in September 2016, in Madrid, Spain. CRV-2016 will draw attention to the invaluable effort of software developers and researchers who contribute in this field by providing the community with new or updated tools, libraries and frameworks for the instrumentation and runtime verification of software. The competition is a product of COST Action “Runtime Verification beyond Monitoring”, see https://www.cost-arvi.eu/ <https://www.cost-arvi.eu/> for more information. Runtime Verification is a verification technique for the analysis of software at execution-time based on extracting information from a
Categories: Incoming News

[RV 2016] RV 2016, Deadlines Extended - Abstract: May 20,Paper/Tutorial: May 27

General haskell list - Mon, 05/09/2016 - 8:26am
Following several requests, the deadlines have been extended as follows: - Abstract deadline: Friday May 20 (AoE). - Paper and tutorial deadline: Friday May 27 (AoE). =============================================== RV 2016 16th International Conference on Runtime Verification September 23-30, Madrid, Spain http://rv2016.imag.fr <https://urldefense.proofpoint.com/v2/url?u=http-3A__rv2016.imag.fr&d=BQMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=6AsiS3HGCiiWbQayKR6NFGJTSnU8_M6_CIkQI2NdBtE&m=82hYGGGDEux2KhgphuqIj7RFX2AOXREa86oSYDTT2BE&s=oBZMLSt69qPHnIrDOKsM7YhIH4Sw92LmOgc2Il-XwdE&e=> Scope Runtime verification is concerned with monitoring and analysis of software and hardware system executions. Runtime verification techniques are crucial for system correctness, reliability, and robustness; they are significantly more powerful and versatile than conventional testing, and more practical than exhaustive formal verification. Runtime verification can be used prior to deployment, for testing, verification, and debugging purposes
Categories: Incoming News

Automatic differentiation (AD) with respect to listof matrices in Haskell

haskell-cafe - Sun, 05/08/2016 - 5:04pm
I am trying to understand how can I use Numeric.AD (automatic differentiation) in Haskell. I defined a simple matrix type and a scalar function taking an array and two matrices as arguments. I want to use AD to get the gradient of the scoring function with respect to both matrices, but I'm running into compilation problems. Here is the code: ------------------------------- {-# LANGUAGE DeriveTraversable, DeriveFunctor, DeriveFoldable #-}import Numeric.AD.Mode.Reverse as Rimport Data.Traversable as Timport Data.Foldable as F --- Non-linear function on "vectors" logistic x = 1.0 / (1.0 + exp(-x) ) phi v = map logistic v phi' (x:xs) = x : (phi xs) --- dot product dot u v = foldr (+) 0 $ zipWith (*) u v --- simple matrix typedata Matrix a = M [[a]] deriving (Eq,Show,Functor,F.Foldable,T.Traversable) --- action of a matrix on a vector mv _ [] = [] mv (M []) _ = [] mv ( M m ) v = ( dot (head m) v ) : (mv (M (tail m)) v ) --- two matrices mbW1 = M $ [[1,0,0],[-1,5,1],[1,2,-3]] mbW2 = M $ [[0,0,0],[1,3,-1],[-2,
Categories: Offsite Discussion

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