It's time!!! Let's do another kick ass event at Porto Alegre.
671, Jari st - Passo da Areia - Porto Alegre | Google Maps Adress => http://g.co/maps/frjub
Ask for "Functional Society" or "Alexandre Poletto"
/* | |
Copyright 2012-2021 Viktor Klang | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
PURE JAVA Arch(2.8.7.7) JBoss Boot Up | |
======================================= | |
21:49:04,594 INFO [ServerImpl] JBoss (Microcontainer) | |
[5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 29s:278ms | |
Scala/JAVA Arch(3.0.0)Jboss Boot UP | |
==================================== | |
21:39:15,830 INFO [ServerImpl] JBoss (Microcontainer) |
import Control.Monad.State | |
import Control.Monad | |
data FibState = F {previous, current :: Integer} | |
fibState0 = F {previous = 1, current = 0} | |
currentFib :: State FibState Integer | |
currentFib = gets current | |
nextFib :: State FibState Integer |
instance Monad Maybe where | |
return x = Just x | |
Nothing >>= f = Nothing | |
Just x >>= f = f x | |
fail _ = Nothing |
class Monad m where | |
return :: a -> m a | |
(>>=) :: m a -> (a -> m b) -> m b | |
(>>) :: m a -> m b -> m b | |
x >> y = x >>= \_ -> y | |
fail :: String -> m a | |
fail msg = error msg |
cd / | |
mkdir /home/diegopacheco | |
echo "export HOME=/home/diegopacheco" >>.bashrc | |
echo "export HOME=/home/diegopacheco" >>.bash_profile | |
cp .bashrc .bash_profile /home/diegopacheco | |
echo "cd" >>.bashrc |
It's time!!! Let's do another kick ass event at Porto Alegre.
671, Jari st - Passo da Areia - Porto Alegre | Google Maps Adress => http://g.co/maps/frjub
Ask for "Functional Society" or "Alexandre Poletto"
This gist and a Functional Society Gist to talk about FP concepts, so people can share links and help each other to get the concepts right and make questions, get you question answered and so on and on...
; | |
; Monads | |
; ====== | |
; | |
; * Without monads "pure" functional programming could be very impractical, Hack! | |
; * You can build environments that support exactly the features that you want | |
; * Functional able todo IO | |
; * Function Composition: LINQ, Unix Pipes | |
; * Good for control tracking of things | |
; * Encapsulating two things: |
system ~/projects/nokogiri $ pickjdk 1 | |
New JDK: 1.6.0.jdk | |
system ~/projects/nokogiri $ jruby -v xmlbench.rb | |
jruby 1.7.0.dev (ruby-1.8.7-p357) (2012-01-10 bd4cc62) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java] | |
11.331000 0.000000 11.331000 ( 11.331000) | |
10.239000 0.000000 10.239000 ( 10.239000) | |
10.185000 0.000000 10.185000 ( 10.185000) | |
10.113000 0.000000 10.113000 ( 10.113000) | |
10.120000 0.000000 10.120000 ( 10.120000) |