This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
------------------------------------------------------------------------------ | |
{- | | |
First, define some example functions. | |
-} | |
------------------------------------------------------------------------------ | |
foo2 :: Int -> Int -> Int | |
foo2 a b = a + b | |
------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Text.Regex (mkRegex, matchRegexAll, Regex) | |
------------------------------------------------------------------------------ | |
{- | Taken from the <http://pleac.sourceforge.net/pleac_haskell/strings.html> | |
'subRegex' allows only a fixed 'String' | |
This custom version takes a ('String' -> 'String') function to compute | |
a result. | |
The function is applied to the all matched results, which are found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.Char (toUpper, toLower) | |
{- | POSIX Regex approach. -} | |
import Text.Regex (mkRegex, subRegex, matchRegexAll, Regex) | |
------------------------------------------------------------------------------ | |
{- | Transforms first element of the 'String' using the function given. -} | |
transformFst :: (Char -> Char) -> String -> String | |
transformFst _ "" = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------- | |
{-| Split a 'String', by specified predicate, but do not remove matched | |
characters from the result. | |
Not an efficient implementation. | |
First, it folds a 'String' to a list of Strings. | |
Elements in the resulting list are in the reversed order, because they | |
are prepended to the final list, not appended. | |
At the end, it reverses the result. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
{-| | |
We use a 'Data.Char' here. Who ever needs to convert | |
to snake_case or CamelCase unicode strings?.. | |
-} | |
import Data.Char (toUpper, toLower, isUpper) | |
----------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body:before { | |
content: ""; | |
position: fixed; | |
top: -10px; | |
left: 0; | |
width: 100%; | |
height: 10px; | |
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,.8); | |
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,.8); | |
box-shadow: 0px 0px 10px rgba(0,0,0,.8); |
NewerOlder