News aggregator

cryptography and homomorphic library support?

haskell-cafe - Thu, 09/18/2014 - 5:38am
Hi, I just perused the crypto section of Hackage and I didn't see any support for homomorphc functions. I didn't see anything .. maybe I missed. If no support, I wouldn't mind giving a shot at working on this as long as no one has already implemented. If someone is working on this, please inform me of contact info so perhaps I can join the team. Kind regards, Vasya
Categories: Offsite Discussion

Haskell Weekly News: Issue 306

General haskell list - Thu, 09/18/2014 - 5:28am
Welcome to issue 306 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from September 07 to 13, 2014 Quotes of the Week * prophile: at this point ekmett is more part of the language than a practitioner of it * Qfwfq: Simon is a title, not a forename. Top Reddit Stories * Haskell for all: Morte: an intermediate language for super-optimizing functional programs Domain: haskellforall.com, Score: 110, Comments: 83 Original: [1] http://goo.gl/MjPyyr On Reddit: [2] http://goo.gl/v2btl4 * AMP has landed in GHC Main! Domain: haskell.org, Score: 88, Comments: 71 Original: [3] http://goo.gl/giu1Xh On Reddit: [4] http://goo.gl/ZGJ76S * [Meta] What's with all these downvotes on beginner questions? Domain: self.haskell, Score: 69, Comments: 67 Original: [5] http://goo.gl/ik2uu2 On Reddit: [6] http://goo.gl/ik2uu2 * Haskell Implementors Workshop 2014 videos [youtube] Doma
Categories: Incoming News

optional ghc-options based on GHC version?

haskell-cafe - Thu, 09/18/2014 - 3:38am
Hi, I have a project here where GHC's option -flate-dmd-anal gets out some extra speed but the flag is not available on 7.6.3. How can I specify in the cabal file that I only want to pass this through when building with 7.8.3 or newer? It'd be a shame to not take advantage of the extra speed on 7.8.3 just because we want to support 7.6.3 too for a bit longer. I was unable to find the info online. Thanks.
Categories: Offsite Discussion

Boolean formula: part2

haskell-cafe - Wed, 09/17/2014 - 8:48pm
Hello! I have following code: buildFormulas :: [Variable] -> Int -> [Formula] buildFormulas vars 0 = map Var vars buildFormulas vars n = join $ forM [0 .. n - 1 ] $ \i -> do x <- buildFormulas vars i y <- buildFormulas vars (n - i - 1) z <- buildFormulas vars (n - 1) let t1 = case z of (Negation _) -> [] _ -> [Negation z] t1 ++ [conj x y, impl x y, disj x y] It is correct, typechecks, but it is insanely slow (calculating take 35 (buildFormulas [P, Q, R] 5) hangs my computer). My guess is that it builds too much before returning first results. Can you suggest more efficent way enumerate formulas of set of variables? -- Best regards, Dmitry Bogatov <KAction< at >gnu.org>, Free Software supporter, esperantisto and netiquette guardian. GPG: 54B7F00D _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

DSL implementation

haskell-cafe - Wed, 09/17/2014 - 7:02pm
HI all, as a part of a project for physical simulation, I'm was given the task to help with the implementation of an Small DSL that is a minimal functional language. Point is that this small language contains some dependent typed theory, because we want to be able to check statically the shapes of vector and matrices, among other things. Haskell of course seems the tool for the job. But my boss insists that the implementation should be done in C, but I think that it is madness. Can someone please point me to relevant literature, discussions or general information that can help me to show my boss that Haskell is the right tool? any help would be appreciated. Felipe Z. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Keegan McAllister: Raw system calls for Rust

Planet Haskell - Wed, 09/17/2014 - 6:33pm

I wrote a small library for making raw system calls from Rust programs. It provides a macro that expands into in-line system call instructions, with no run-time dependencies at all. Here's an example:

#![feature(phase)]

#[phase(plugin, link)]
extern crate syscall;

fn write(fd: uint, buf: &[u8]) {
unsafe {
syscall!(WRITE, fd, buf.as_ptr(), buf.len());
}
}

fn main() {
write(1, "Hello, world!\n".as_bytes());
}

Right now it only supports x86-64 Linux, but I'd love to add other platforms. Pull requests are much appreciated. :)

Categories: Offsite Blogs

Constructors on left and right hand sides of equation

haskell-cafe - Wed, 09/17/2014 - 3:03pm
Dear list In Eq 1 is (NewGlass i) on the LHS distinct from (NewGlass i) on the RHS? In Eq2 are the occurrences of the data constructor Fill on the LHS and RHS distinct? Thanks Pat data Glass = NewGlass Int | Fill Glass Int deriving Show drink :: Glass -> Int -> Glass drink (NewGlass i) j = (NewGlass i) -- Eq 1 drink (Fill m i) j | full (Fill m i) = Fill (NewGlass (size m)) ((size m) - j) -- Eq 2 | (i >= j) = Fill m (i-j) | otherwise = drink m (j-1) size :: Glass -> Int size (NewGlass i) = i size (Fill m i) = size m level :: Glass -> Int level (NewGlass i) = 0 level (Fill m i) | (level m) + i > (size m) = size m | otherwise = (level m) + i empty :: Glass -> Bool empty m = (level m) == 0 full :: Glass -> Bool full m = (level m) == (size m) {- drink (Fill (NewGlass 4) 5) 5 drink (Fill (NewGlass 4) 3) 3 -}
Categories: Offsite Discussion

I have created... dumb sort.

Haskell on Reddit - Wed, 09/17/2014 - 2:47pm
atBeginning xs x = uncurry (++) $ partition (==x) xs dumbSort xs = foldl atBeginning xs [maximum xs, maximum xs - 1..minimum xs]

Efficient on lists of small numbers!

submitted by Undo_all
[link] [2 comments]
Categories: Incoming News

Philip Wadler: The military and the referendum.

Planet Haskell - Wed, 09/17/2014 - 2:42pm

Many readers will have heard about Lord Dannat in the Telegraph arguing a vote for independence will dishonour Scotland's war dead.

Perhaps not as many will have heard that Jimmy Sinclair (the oldest surviving Desert Rat, aged 102), Colin May (Lieutenant Commander, Faslane), and sixteen others have written a letter slamming Dannat; at least, I didn't hear until this morning. "How dare he take their sacrifice in vain and try to turn it to political advantage?"

Both sides are reported by the BBC, though the headline mentions only one. (More #bbcbias?)

Categories: Offsite Blogs

Eric Kidd: Deploying Rust applications to Heroku, with example code for Iron

Planet Haskell - Wed, 09/17/2014 - 2:35pm

Now with support for Iron, Cargo and Cargo.lock!

You can deploy an example Rust application to Heroku using this button:

If you'd prefer to use the command line, you'll need git and the Heroku toolbelt. Once these are installed, run:

git clone https://github.com/emk/heroku-rust-cargo-hello.git cd heroku-rust-cargo-hello heroku create --buildpack https://github.com/emk/heroku-buildpack-rust.git git push heroku master

This will download the example application, create a new Heroku project, and deploy the code to Heroku. That's it!

How it works

Our server is based on the Iron middleware library. We parse URL parameters and dispatch HTTP requests to the appropriate handler routine using Iron's router module:

fn main() { let mut router = Router::new(); router.get("/", hello); router.get("/:name", hello_name); Iron::new(router).listen(Ipv4Addr(0, 0, 0, 0), get_server_port()); }

The hello function returns an HTTP status code and the content to send to the user:

fn hello(_: &mut Request) -> IronResult<Response> { Ok(Response::with(status::Ok, "Hello world!")) }

The hello_name function is similar, but we look up the value of the :name parameter that we declared to the router, above.

fn hello_name(req: &mut Request) -> IronResult<Response> { let params = req.extensions.find::<Router,Params>().unwrap(); let name = params.find("name").unwrap(); Ok(Response::with(status::Ok, format!("Hello, {}!", name))) }

The final piece needed to run on Heroku is a function to look up up our port number:

fn get_server_port() -> Port { getenv("PORT") .and_then(|s| from_str::<Port>(s.as_slice())) .unwrap_or(8080) }

The full source code is available on GitHub. To learn more about Rust, see the excellent Rust guide.

Keep reading for notes on building the program locally and on configuring your own programs to run on Heroku.

Read more…

Categories: Offsite Blogs

Philip Wadler: The case for Europe

Planet Haskell - Wed, 09/17/2014 - 2:10pm
<iframe frameborder="0" height="500" src="http://www.bbc.co.uk/emp/embed/smpEmbed.html?playlist=http%3A%2F%2Fwww.bbc.co.uk%2Fiplayer%2Fplaylist%2Fp026txk6&amp;title=Today%3A%2017%2F09%2F2014%3A%20Salmond%20promises%20%22common-sense%20agreement%20on%20a%20common%20currency%E2%80%9D&amp;product=iplayer" width="400"></iframe>
Readers of this list will know that I don't always see eye-to-eye with Alex Salmond. Nonetheless, I think he put the case for Europe well this morning on the Today Program.In a BBC interview just the other night, a spanish minister being
interviewed by Kirsty Wark despite being invited three or four times
refused to say that Spain would attempt to veto Scottish
membership. And the reason for that of course is that the Spanish
government have already said that in the circumstance of a consented
democratic referendum, as they put it, Spain would have nothing to say
about it.

We can go through legal opinion and expert opinion as much as we like.
I think the answer is in four figures: 1, 20, 25, and 60.

1% is the percentage of Scotland's population compared to the European Union.

20% is the percentage of the fish stocks of the entire European Union.

25% is the percentage of the renewable energy of the entire European Union offshore.

And 60% is the oil reserves that Scotland has.

Anyone who believes that a country [with these resources] is not
going to be welcome in the wider Europe doesn't understand the process
by which Europe accepts democratic results and that Scotland has a
huge amount of attractiveness to the rest of the European continent.
You can hear the original here, the relevant segment starts at around 8:00.
Categories: Offsite Blogs

Fairly small projects (~1 to 7 days) to do and learn from?

Haskell on Reddit - Wed, 09/17/2014 - 12:39pm

I recently started using haskell and it's quickly become my favorite language. Unfortuantly, I have nothing to apply it to. What are some small projects I can do for fun and to practice my skills?

submitted by Undo_all
[link] [18 comments]
Categories: Incoming News

Injective type families for GHC - syntax proposals

haskell-cafe - Wed, 09/17/2014 - 12:10pm
Haskellers, there is some discussion going on at the moment about implementing injective type families in GHC [1]. I'd like to hear your opinions on proposed syntax for this new feature. == Problem == Currently GHC assumes that type families are not injective. This is of course conservative and the idea behind implementing injective type families is to allow the programmer to explicitly declare that a type family has the injectivity property (which GHC will of course verify). == Forms of injectivity == Injectivity can take forms more complicated than just determining the LHS from RHS: A. RHS determines all arguments on the LHS. Example: type family Id a where Id a = a Here the RHS uniquely determines LHS. B. RHS determines some but not all arguments on the LHS. Example (contrieved): type family G a b c where G Int Char Bool = Bool G Int Char Int = Bool G Bool Int Int = Int Here RHS uniquely determines `a` and `b` but not `c`. C. RHS and some LHS ar
Categories: Offsite Discussion

ANN: HacBerlin - Haskell Hackathon in Berlin,26-28 Sep 2014

General haskell list - Wed, 09/17/2014 - 10:01am
Hi everyone, this is just a quick reminder: The Haskell Hackathon in Berlin starts in 9 days and there are very few places left. Please register now: http://goo.gl/aLfnWu Where: Berlin, Germany When: Fri 26 - Sun 28 September 2014 We will do lots of Haskell hacking and listen to two excellent talks: * Beyond Parsec -- Revisiting Parser Combinators, by Andres Löh * Chordify: Advanced Functional Programming for Fun and Profit, by José Pedro Magalhães Meet in Berlin, discuss, hack together and improve the Haskell infrastructure. We welcome all programmers interested in Haskell, beginners and experts! For all details, visit our wiki page (http://www.haskell.org/haskellwiki/HacBerlin2014) and make sure to register now! Cheers, Stefan
Categories: Incoming News