1
1
mirror of https://github.com/sdiehl/wiwinwlh.git synced 2024-08-16 23:40:41 +03:00

include fonts

This commit is contained in:
Stephen Diehl 2016-03-22 21:00:59 -04:00
parent 24eef99807
commit e3af3fb299
10 changed files with 269 additions and 32 deletions

View File

@ -1,6 +1,7 @@
@import url(http://fonts.googleapis.com/css?family=Signika);
@import url(http://fonts.googleapis.com/css?family=Fira+Sans);
@import url(http://fonts.googleapis.com/css?family=Source+Code+Pro);
@font-face {
font-family: 'Fira Sans';
src: url(../fonts/FiraSans-Regular.ttf);
}
html {
}
@ -15,7 +16,9 @@ body {
color: #332;
margin: 0px;
padding: 0px;
padding-left: 0px;
padding-right: 0px;
line-height: 1.4;
-webkit-font-feature-settings: "kern", "liga";
@ -37,6 +40,11 @@ pre {
background-color: inherit;
}
code {
color: inherit;
background-color: inherit;
}
pre code {
/*font: 15px/19px Inconsolata, Monaco,"Lucida Console",Terminal,"Courier New",Courier;*/
font: 12pt "Source Code Pro";
@ -64,6 +72,10 @@ img {
margin: 0 auto;
}
.body {
padding-top: 20px;
}
/* TOC Links */
.sidebar-nav ul {
list-style-type: none;

View File

@ -1,2 +1,8 @@
rsync css/style.css ec2:~
ssh ec2 'sudo mv style.css /srv/http/hask/css/style.css'
rsync css/sidebar ec2:~
ssh ec2 'sudo mv sidebar.css /srv/http/hask/css/sidebar.css'
rsync tutorial.html ec2:~
ssh ec2 'sudo mv tutorial.html /srv/http/hask/index.html'

BIN
fonts/FiraSans-Regular.ttf Normal file

Binary file not shown.

BIN
fonts/Signika.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
img/fork.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -47,7 +47,7 @@
</head>
<body>
<a href="https://github.com/sdiehl/wiwinwlh" class="fork"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<a href="https://github.com/sdiehl/wiwinwlh" class="fork"><img style="position: absolute; top: 0; right: 0; border: 0;" src="img/fork.png" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<div>

View File

@ -0,0 +1,20 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
import Data.Text
data Example = Example
{ e1 :: Int
, e2 :: Text
, e3 :: Text
} deriving (Show)
-- Extracting from a record using wildcards.
scope :: Example -> (Int, Text, Text)
scope Example {..} = (e1, e2, e3)
-- Assign to a record using wildcards.
assign :: Example
assign = Example {..}
where
(e1, e2, e3) = (1, "Kirk", "Picard")

View File

@ -0,0 +1,43 @@
module Main where
import Control.Monad.Trans
import System.Console.Repline
import Data.List (isPrefixOf)
import System.Process (callCommand)
type Repl a = HaskelineT IO a
-- Evaluation : handle each line user inputs
cmd :: String -> Repl ()
cmd input = liftIO $ print input
-- Tab Completion: return a completion for partial words entered
completer :: Monad m => WordCompleter m
completer n = do
let names = ["kirk", "spock", "mccoy"]
return $ filter (isPrefixOf n) names
-- Commands
help :: [String] -> Repl ()
help args = liftIO $ print $ "Help: " ++ show args
say :: [String] -> Repl ()
say args = do
_ <- liftIO $ callCommand $ "cowsay" ++ " " ++ (unwords args)
return ()
options :: [(String, [String] -> Repl ())]
options = [
("help", help) -- :help
, ("say", say) -- :say
]
ini :: Repl ()
ini = liftIO $ putStrLn "Welcome!"
repl :: IO ()
repl = evalRepl ">>> " cmd options (Word0 completer) ini
main :: IO ()
main = repl

View File

@ -2100,6 +2100,22 @@ it :: Num a => a
it :: Num a => a
```
Extended Defaulting
-------------------
```haskell
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
import qualified Data.Text as T
default (T.Text)
example = "foo"
```
TODO
Safe Haskell
------------
@ -2282,6 +2298,15 @@ LambdaCase
PackageImports
-------------
Package imports allows us to disambiguate hierarchical package names by their
respective package key. This is useful in the case where you have to imported
packages that expose the same module. In practice most of the common libraries
have taken care to avoid conflicts in the namespace and this is not usually a
problem in most modern Haskell.
For example we could explicitly ask GHC to resolve that ``Control.Monad.Error``
package be drawn from the ``mtl`` library.
```haskell
import qualified "mtl" Control.Monad.Error as Error
import qualified "mtl" Control.Monad.State as State
@ -2292,9 +2317,12 @@ RecordWildCards
---------------
Record wild cards allow us to expand out the names of a record as variables
scoped as the labels of the record implicitly.
scoped as the labels of the record implicitly. The extension can be used to
extract variables names into a scope or to assign to variables in a record
drawing, aligning the record's labels with the variables in scope for the
assignment. The syntax introduced is the ``{..}`` pattern selector.
~~~~ {.haskell include="src/04-extensions/wildcards.hs"}
~~~~ {.haskell include="src/04-extensions/wildcards_update.hs"}
~~~~
PatternSynonyms
@ -2339,6 +2367,8 @@ module MyModule (
pattern Elt = [a]
```
* [Pattern Synonyms in GHC 8](http://mpickering.github.io/posts/2015-12-12-pattern-synonyms-8.html)
ApplicativeDo
-------------
@ -2372,6 +2402,11 @@ TypeInType
TypeApplication
-----------------
Minimal Annotations
-------------------
TODO
<hr/>
Laziness
@ -2607,6 +2642,9 @@ operator.
f $! x = let !vx = x in f vx
```
Strict Haskell
--------------
Deepseq
-------
@ -3732,6 +3770,8 @@ See:
spoon
-----
TODO
See: [Spoon](https://hackage.haskell.org/package/spoon)
Advanced Monads
@ -4019,6 +4059,16 @@ Haxl
TODO
resource-pool
-------------
TODO
resourcet
-------------
TODO
<hr/>
Quantification
@ -5096,9 +5146,13 @@ Unit tests
silently
--------
TODO
tasty-golden
------------
TODO
Type Families
=============
@ -6675,6 +6729,9 @@ TODO
* [generics-sop](https://hackage.haskell.org/package/generics-sop)
* [Applying Type Level and Generic Programming in Haskell](https://github.com/kosmikus/SSGEP/blob/master/Lecture1.pdf)
generics-eot
----------------
Uniplate
--------
@ -8274,7 +8331,7 @@ postgresql-simple
TODO
msyql-simple
mysql-simple
-----------------
TODO
@ -8307,6 +8364,60 @@ This is an advanced section, knowledge of GHC internals is not typically
necessary.
</div>
GHC Api
-------
GHC is effectively just a very large (and quirky) Haskell library that
transforms Haskell source code into executable code.
```haskell
import GHC
import GHC.Paths (libdir)
import DynFlags
targetFile :: FilePath
targetFile = "B.hs"
example :: IO ()
example =
defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags dflags
target <- guessTarget targetFile Nothing
setTargets [target]
load LoadAllTargets
modSum <- getModSummary $ mkModuleName "B"
p <- parseModule modSum -- ModuleSummary
t <- typecheckModule p -- TypecheckedSource
d <- desugarModule t -- DesugaredModule
l <- loadModule d -- CoreModule
c <- return $ coreModule d -- CoreModule
g <- getModuleGraph
mapM showModule g
return $ (parsedSource d,"/n-----/n", typecheckedSource d)
main :: IO ()
main = do
res <- example
putStrLn $ showSDoc ( ppr res )
```
TODO
Artifacts
----------
* ParsedModule
* TypecheckedModule
* DesugaredModule
* CoreModule
TODO
Located
-------
@ -8336,6 +8447,11 @@ srcSpanStart :: SrcSpan -> SrcLoc
srcSpanEnd :: SrcSpan -> SrcLoc
```
Outputable
----------
TODO
Types
-----
@ -8412,14 +8528,6 @@ Types
TODO
Artifacts
----------
* ParsedModule
* TypecheckedModule
* DesugaredModule
* CoreModule
Wired-in Types
----------
@ -8793,11 +8901,26 @@ See:
Rewrite Rules
-------------
<div class="alert alert-danger">
This is an advanced section, and is not typically necessary to write Haskell.
</div>
TODO
* [Using Rules](https://wiki.haskell.org/GHC/Using_rules)
* [Rewrite Rules](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/rewrite-rules.html)
Fusion
------
<div class="alert alert-danger">
This is an advanced section, and is not typically necessary to write Haskell.
</div>
TODO
* [List Fusion](https://downloads.haskell.org/~ghc/7.10.3/docs/html/users_guide/rewrite-rules.html)
Dictionaries
------------
@ -9938,30 +10061,20 @@ trusted: safe-inferred
require own pkg trusted: False
```
ghc-prim
--------
TODO
Outputable
----------
TODO
haskell-suite
* haskell-src-exts
-------------
TODO
* haskell-src-exts
* haskell-names
* haskell-packages
ghc-exact-print
-------------
TODO
See:
* [A New Foundation For Refactoring Tools](http://mpickering.github.io/posts/2015-07-23-ghc-exactprint.html)
Profiling
=========
@ -10159,6 +10272,44 @@ getInputLine :: String -> InputT IO (Maybe String)
Repline
---------
Certain sets of tasks in building command line REPL interfaces are so common
that is becomes useful to abstract them out into a library. While haskeline
provides a sensible lower-level API for interfacing with GNU readline, it is
somewhat tedious to implement tab completion logic and common command logic over
and over. To that end Repline assists in building interactive shells that that
resemble GHCi's default behavior.
~~~~ {.haskell include="src/30-languages/repline.hs"}
~~~~
Trying it out. (``<TAB>`` indicates a user keypress )
```bash
$ runhaskell Simple.hs
# Or if in a sandbox: cabal exec runhaskell Simple.hs
Welcome!
>>> <TAB>
kirk spock mccoy
>>> k<TAB>
kirk
>>> spam
"spam"
>>> :say Hello Haskell
_______________
< Hello Haskell >
---------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
```
* [repline](https://github.com/sdiehl/repline)
Template Haskell
================
@ -10570,7 +10721,12 @@ See: [file-embed](https://hackage.haskell.org/package/file-embed)
git-embed
----------
TODO
Often times it is neccessary to embed the specific Git version hash of a build
inside the exectuable. Using git-embed the compiler will effectivelly shell out
to the command line to retrieve the version information of the CWD Git repostory
and use Template Haskell to define embed this information at compile-time. This
is often useful for embedding in ``--version`` information in the command line
interface to your program or service.
```haskell
{-# LANGUAGE TemplateHaskell #-}