Two research assistantships in model-driven engineeringand semantic technologies, University of Oxford
A function f :: A -> B -> C can be applied in infix form where:a `f` b <=> f a b
I think this is a mistake and that it should instead have been:a `f` b <=> f b a
sepBy (from Parsec) is a typical example of the problem. In Haskell we can either write:p `sepBy` (symbol ",")
or:sepBy p (symbol ",")
But the second form looks strange and swapping the arguments would make the infix form look strange instead.
A similar example is asTypeOf. Consider:asTypeOf 1 int
It looks wrong because, like sepBy, it is made to appear natural when used in infix form:1 `asTypeOf` int
If `f` = flip f this would not have been a problem. This would also allow the familiar object-method syntax (for those who like that):[1,2,3] `map` f <=> map f [1,2,3] 'A' replicate 5 <=> replicate 5 'A' m `lookup` 'b' <=> lookup 'b' m 5 `mod` 2 <=> mod 2 5
Note that mod 2 would be a modulo 2 function, which IMO is more intuitive than a function taking 2 modulo something.
My wish was that infix function application should flip it's arguments to rid strange things like this:subtract 2 5 == 3 -- good 5 `subtract` 2 == -3 -- what?
This discussion has given me insights to change my mind on this. Here is why.
First, some really good counter examples came up. Functions like zip and mappend works fine as things are now:mappend [1,2] [3,4] == [1,2,3,4] == [1,2] `mappend` [3,4]
Flipping the arguments for the infix form would make it awkward.
Then it was pointed out that(&) = flip ($)
can be used to "infix" a function to it's flipped form, so that5 &subtract 2 == 3
as expected. (Compared to the infix form)
Also & is to be added to Data.Function (to my understanding) so will became standardized.
This means we can both eat the cake and have it too!
Still, I maintain that some functions such as mod and sepBy have their arguments in wrong order. Even more so when & comes along. I agree with fridofrido that argument order should by convention be driven by the pattern of partial application.submitted by togrof
[link] [79 comments]
Green energy / IoT startup Moixa Technology is seeking to add to our software team.
We're a small team dedicated to developing technology that enables a radical change in the way that energy is used in the home. We are just ramping up to deliver a project (working with large energy companies) demonstrating how communities can use the Maslow system across a group of homes to share energy in that community. We will need to deploy software that addresses some challenging problems to make this possible.
The code that we develop is built around providing services based on the hardware systems that we are deploying and so needs to work with the constraints and characteristics of the hardware & low level firmware we have built.
We're looking for individuals with generalist approach that are willing and and able to participate in all aspect of design, implementation and operation of our platform. The candidate must be happy in a small team, and also able to work autonomously. We are expanding as we ramp up to deliver the next generation of control software to our increasing number of deployed system. This is an exciting moment for the company.
- Design & implemetation of all parts of our software stack (web frontend & backend, data analytics, high-level code on IoT devices)
- Operations support (expected <20% of time)
Our current stack involves:
- Scala (Akka, Play) / ClojureScript / Haskell
- Postgres, neo4j
- Raspberry PI / Arch Linux
- PIC32 microcontroller / C
Skills and Requirements:
- Experience in one or more functional languages
- Familiarity with at least one database paradigm
- Linux scripting and operation
- Familiarity with (strongly) typed functional languages (Haskell/ML/Scala)
- Embedded programming experience
- Experience in data analytics (Spark or similiar)
- Experience in IoT development
- Open Source contributions
Moixa technology is based in central London (Primrose Hill), Salary depending on experience + performance based share options.
Get information on how to apply for this position.
I'm in a computational physics class that is based on the Haskell programming language. My professor uses a linux machine and I have a windows machine (64 bit).
I'm having trouble finding a quick/simple/easy to use IDE/Text Editor for Haskell. So far, the best/easiest I've found is Sublime Text 2 with the Haskell extension (incredibly easy to install, very fluid interface)
It pains me to admit that I'm not too command line savvy... so a lot of these things go over my head. Do you guys know of any simple to install Text Editor that works with Haskell? I'm hoping I can just run a .exe and have the program install and work, rather than having to navigate through a maze of directories that I'm unfamiliar with.
Thanks for any help you can provide!submitted by sqrlsattack
[link] [25 comments]