Earlier this year, I wrote a blogpost about our plans for the next version of the School of Haskell. SoH is a community service and project to make it possible to use interactive snippets of Haskell on any website, in particular on schoolofhaskell.com. Today, we are open sourcing the SoH 2.0 repositories! We've also retired FP Haskell Center, and SoH pages that were previously on fpcomplete.com now redirect to schoolofhaskell.com.
Here's the current status of the different parts:
Here's the repo main SoH code, which includes the browser client and API service. Once the service side of things is ready, they will allow you to embed interactive Haskell snippets in any website!
The soh-client is written using GHCJS, and provides a code editing widget. It uses ghcjs-react to separate the view from the model / controller. It utilizes some of GHCJS's fancier features, such as fully supporting concurrency and STM.
The soh-scheduler provides a REST API for requesting that a container running soh-runner gets spun up. We ran into some issues with deployment to ECS, likely due to our huge docker images. Our plan is to rework / rewrite the service code to instead target Kubernetes. Since the initial implementation of SoH 2.0, we've had a lot of positive experiences with kubernetes, and would prefer to use it.
The schoolofhaskell.com repo repo contains code based on code for the fpcomplete.com site. It is served from schoolofhaskell.com. The contents of the site is not yet interactive, as the kubernetes based version of soh-scheduler still needs to be written and deployed.Future Improvements
There are quite a few immediate things to work on in SoH, in particular, the switch to kubernetes, and integrating the new client with schoolofhaskell.com. Once these things are resolved, there are also some interesting possibilities. Ever since the client code was initially written, a number of developments have occurred that it might leverage:
One such development is haskell-ide-engine, a project to centralize our efforts on providing Haskell tools (particularly those that use GHC), as a service to text editors and IDEs. We'd like to focus our efforts in this direction on haskell-ide-engine, rather than stack-ide. This means that in the future, SoH may be based on haskell-ide-engine, along with some selection of its plugins. I encourage people to dive into helping with HIE, to bring it to a point where it makes Haskell development excellent, and to make it fit for usage SoH 2.0.
Another interesting development is Ryan Trinkle's excellent reflex library for reactive UI. While using react was quite nice overall, I ended up hacking around some of the paradigm. I think things would work out cleaner with reflex / reflex-dom, and this way SoH development can benefit that project!
Capital Match is the leading peer-to-peer lending platform in Singapore. Our in-house platform, mostly developed in Haskell, currently manages more than S$ 4 million in different type of facilities and is growing fast. We have closed our series A funding round about 6 months ago and are looking forward to a new round, most probably for middle of 2016. We are now embarking on the next stage of tech development to extend our set of features, strengthen our platform and develop new products. We are hiring an experienced backend software engineer to join the team.Responsibilities
We are looking for an experienced (5+ years) software engineer interested in all aspects of the creation, growth and operations of a secure web-based platform: front-to-back features development, distributed deployment and automation in the cloud, build and test automation etc. Like all team members you will be in charge of development of new features from early design and prototyping to maintenance in production, and of exploring innovative solutions to answer current and future business needs.Requirements
Our platform is primarily developed in Haskell with an Om/ClojureScript frontend. This job's focus being primarily on backend we are expecting our candidate to have experience working with a functional programming language, e.g. Scala/OCaml/F#/Clojure/Lisp/Erlang. Of course, demonstrable experience in Haskell would definitely be a plus.
Deployment and production is managed with Docker containers using standard cloud infrastructure so familiarity with Linux systems, command-line environment and cloud-based deployment is mandatory.
Experience in web-based software development is essential and minimum exposure to and understanding of XP practices (TDD, CI, Emergent Design, Refactoring, Peer review and programming, Continuous improvement) is expected. These are standard practices within the team. We therefore favour candidates who value simplicity and respect, accept and give feedback and who are generally team player.
Our team is distributed so ability to work comfortably in a distributed setting is essential. We will favor candidates that are living in or willing to relocate to Singapore, but we are also open to candidates willing to work remotely provided they can demonstrate solid experience with such a setting.Offer
We offer a combination of salary and equity depending on experience and skills:
Salary: USD 4,000-8,000 / month
Equity: 0.3-1% (subject to vesting)
European citizens who relocate to Singapore do not have to pay their home country taxes and the local tax rate in Singapore is around 2-5% (effective on the proposed salary range). Visa sponsorship will be provided.
Singapore is a great place to live, a vibrant city rich with diverse cultures, a very strong financial sector and a central position in Southeast Asia.
Get information on how to apply for this position.
Hello /r/haskell, I am currently trying to structure my Advent of Code answers (even though this is not necessarily relevant to my question, it might help to illustrate). My individual solutions work fine, but I wanted to structure everything as a bit more as a whole project, I'm also just curious how to handle things like this in other scenarios.
I organized my haskell project through stack and the folder structure looks like this:myproject/ src/ Code2015/DayXX.hs Main.hs cabal,yaml files etc.
Every individual file/module is named like module Code2015.Prob01 where.
Looking at my Main.hs, importing them with import Code2015.Prob01 import Code2015.Prob02 works fine. But being able to simply use import Code2015seems like a neat option.
This is the point where my knowledge on organizing haskell projects becomes really wonky, which leads to my questions: Whats the best way to handle this? Create an additional module Code2015 which imports and exports every submodule? If so, how is this done (and configured properly in the .cabal file)?
Note: I tried this already and it lead to some weird problems, I was able to import Code2015 in my Main.hs, and use the solutions of every Day by using Code2015.Prob01.solutions in ghci, but I was not able to use it like this in my main :: IO (). It was also complaining about ambiguous names while creating the Code2015 module, since I got a solutions :: IO () in every module.submitted by worst_mathematician
[link] [2 comments]
I've been trying to understand the contrastive divergence training of RBMs and back-propagation for NNs, so I implemented them in Haskell, and it works! Take a look at https://github.com/aeyakovenko/rbm. I would love some feedback. Cross-post from /r/machinelearningsubmitted by aeyakovenko
[link] [10 comments]
Hi, I have been looking for a cabal package that handle CNN (Convolutionnal Neural Network) with no success. Is there such a package available?
Thanks!submitted by Dref360
[link] [11 comments]
I figured it out now, but my first instinct was to recreate the error by evaluating by hand. So, I typed
Prelude> 2 ^ 3
Prelude> 8 ^ 4
Prelude> 4096 ^ 5
1152921504606846976 (I hope I typed that correctly)
But, then, I realized, this was being associated in the other direction. So, I checked that out by hand.
prelude> 4 ^ 5 1024 Prelude> 3 ^ 1024 --do I dare even test this one? it will be a 300+ digit number.
3733918(etc) . . . .for 4 lines. I can't even guess how much it would take to calculate 2 ^ (300 digit number) but it would require more than the known universe turned into RAM memory to store the result.
So, at first I wondered what was wrong with Stack ghci, but now, just take this as a friendly public service announcement.submitted by Xalem
[link] [36 comments]
So I've read this: http://degoes.net/articles/modern-fp/ and a few years ago I also read this: http://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html
I "get" the mechanism for free monads, and catamorphisms, and algebras. Unfortunately, I'm still not convinced by the utility. When should I actually whip out a free monad? When is it that I really do need the flexibility of interpreters, and how is that more or less appropriate than the traditional approach of typeclasses, or multiparameter typeclasses? I see a lot of "how", and "what", but I think the articles I've linked to don't give a lot of "why"! What's the motivation, and what are the tradeoffs?submitted by saposcat
[link] [46 comments]
- December 30th, 2015: You have a string of 'digits' in base whatever to convert to an Int
debase :: [Int] -> Int -> Int
debase [12,21,3] 26 ~> 8661
- Gautier DI FOLCO @gautier_difolco
debase = curry (sum . uncurry (zipWith (*)) . bimap reverse (flip iterate 1 . (*)))
- bazzargh @bazzargh
debase a b = sum $ zipWith (*) (reverse a) (map (b^) [0..])
- obadz @obadzz
or debase l b = foldl (\ p n -> p * b + n) 0 l
- bazzargh @bazzargh
that's better than mine. how about:
flip (foldl1 . ((+) .) . (*))
- December 12th, 2015: #math You have this sequence: [1,1,1,1,1,1,2,1,1,1,3,3] What is this pattern? Is there one? Write #haskell to generate this list.
- December 3rd, 2015: Lens-y again Points-free-itize the following correctName :: Row -> Row correctName r = set lastName (init (view lastName r)) r
- December 3rd, 2015: Let's get a little lens-y with this one: accumer :: Getter a t a -> t -> [a] -> [a] accumer f s acc = ans where ans = view f s:acc
- Define the curried-accumer function that curries away the acc-argument.
- What would the curried definition be if the function type were: accumer :: Getter a t a -> t -> Set a -> Set a
- December 3rd, 2015: define minimax :: Ord eh => eh -> (eh, eh) -> (eh, eh) such that, e.g.: minimax 1 (2,3) ~> (1,3) minimax 10 (2,3) ~> (2,10)
- Thomas Dietert @thomasdietert In that case, minimax n (x,y) = (minimum [n,x,y], maximum [n,x,y])
- joomy @cattheory minimax = liftM2 (***) min max
- December 1st, 2015: define (->>) :: (a -> m ()) -> (a -> m ()) -> a -> m () All monadic effects must be evaluated.
- Jérôme @phollow (->>) f g a = f a >> g a
- then liftM2 (>>)
- Nicoλas @BeRewt but the full applicative is: liftA2 (*>)
I am writing a parser for email's headers with attoparsec. But while trying to optimize this code I stumble upon several questions that I cannot answer by myself.
So naturally I am looking for the help of the community.
Is function call cheap in haskell ? Because when displaying cost center with +RTS -p two near function's calls in the code seem pretty distant in time. (in a flamegraph you can detect that with huge gap between each step of the call stack). Inlining function seems to overcome most of this not solicited overhead.
Is it possible to see strictness in Haskell/GHC ? Often time I want to see at a certain point in the program (at runtime), what have been evaluated or not. Is there an equivalent of traceShow but for strictness ? This traceStrict will (without forcing any evaluation) recursively show the state of a variable (thunks, WHNF, NF, ...) Most of the time I am trying to guess around and add some $!, (or just adding it everywhere and see if it's making a difference). Or is it possible to use ghc to dump intermediate representation to see this at compile time ?
Why MonoTraversable is faster than Traversable ? I tend to use classyPrelude everywhere in my programs in replacement for prelude. By default classyPrelude uses functions from MonoTraversable instead of Traversable. For a reason that I cannot explain the Monoidic version seems faster. What is the benifit of adding the Monoid constraint instead of just using the Generic version ?
What's the difference between
Thisfunc = do ... toto where toto = do ...
andtoto = do .... func = do ... toto
For me there is none, but when I changed the first version for the later one. Performance seemed to improve for unknown reasons.
Any explanation will be welcome :)Compilation of answers
- Is function call cheap in haskell ?
Look at tibbe answer
- Is it possible to see strictness in Haskell/GHC ?
In GHCi you can use :sprint to print a variable without forcing its evaluation. I think if you stop the program in the GHCi debugger you should be able to then check if a value is a thunk or not
It's the perfect solution for me
Look at the intermediate output (-ddump-simpl) you can see if e.g. arguments are passed unboxed (e.g. Int#) or boxed (e.g. Int)
It's works but the dump is really tedious to read (at least with my current knowledge)
For more information about the runtime behavior
- What's the difference between
Top level functions are more likely to get inlined and memoized than where functions IIRC.submitted by erebe
[link] [11 comments]
Compared to Python/Java/C++, I find it really hard to read Haskell build errors. Does anyone have tips on how I could understand errors better?submitted by Maplicant
[link] [8 comments]