├── .arcconfig ├── .dir-locals.el ├── .ghci ├── .gitignore ├── LICENSE ├── README.md ├── Setup.hs ├── config └── routes ├── design ├── design.svg ├── drawing.svg ├── landing.svg ├── layout.svg └── logo.svg ├── hl.cabal ├── hl.org ├── scripts ├── deploy ├── pull-build └── restart ├── src ├── .dir-locals.el ├── Data │ └── Conduit │ │ ├── List │ │ └── TakeDrop.hs │ │ └── TakeDrop.hs ├── DevelMain.hs ├── HL │ ├── Controller.hs │ ├── Controller │ │ ├── Community.hs │ │ ├── Documentation.hs │ │ ├── Donate.hs │ │ ├── Downloads.hs │ │ ├── Home.hs │ │ ├── Irc.hs │ │ ├── MailingLists.hs │ │ ├── Markdown.hs │ │ └── News.hs │ ├── Development.hs │ ├── Dispatch.hs │ ├── Foundation.hs │ ├── Model.hs │ ├── Model │ │ ├── Home.hs │ │ ├── Markdown.hs │ │ ├── News.hs │ │ └── Videos.hs │ ├── Static.hs │ ├── Types.hs │ ├── View.hs │ └── View │ │ ├── Code.hs │ │ ├── Community.hs │ │ ├── Documentation.hs │ │ ├── Donate.hs │ │ ├── Downloads.hs │ │ ├── Home.hs │ │ ├── Home │ │ └── Features.hs │ │ ├── Markdown.hs │ │ ├── News.hs │ │ └── Template.hs ├── Main.hs ├── Text │ └── Blaze │ │ ├── Bootstrap.hs │ │ └── Extra.hs └── Yesod │ ├── Caching.hs │ ├── Lucid.hs │ └── Slug.hs ├── stack.yaml ├── static ├── css │ ├── hl.css │ ├── hl.min.css │ └── report.css ├── fonts │ ├── Haskell.dev.svg │ ├── Haskell.eot │ ├── Haskell.svg │ ├── Haskell.ttf │ ├── Haskell.woff │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── img │ ├── community.jpg │ ├── community.png │ ├── favicon.ico │ ├── haskell-logo.svg │ ├── logo.png │ ├── pattern.png │ └── rackspace.svg ├── js │ ├── bootstrap.min.js │ ├── donate.js │ ├── highlight.pack.js │ ├── home.js │ ├── jquery.console.js │ ├── jquery.cookie.js │ ├── jquery.js │ ├── report.js │ ├── tryhaskell.js │ ├── tryhaskell.pages.js │ └── warp.reload.js ├── markdown │ ├── downloads-main.md │ ├── home.md │ ├── irc.md │ ├── linux-install.md │ ├── mailing-lists.md │ ├── manual-install.md │ ├── osx-install.md │ └── windows-install.md ├── report │ └── haskell2010 │ │ ├── haskell.css │ │ ├── haskell.html │ │ ├── haskell0x.png │ │ ├── haskell12.html │ │ ├── haskell1x.png │ │ ├── haskell2x.png │ │ ├── haskell3x.png │ │ ├── haskell4.html │ │ ├── haskell4x.png │ │ ├── haskell9.html │ │ ├── haskellch1.html │ │ ├── haskellch10.html │ │ ├── haskellch11.html │ │ ├── haskellch12.html │ │ ├── haskellch13.html │ │ ├── haskellch14.html │ │ ├── haskellch15.html │ │ ├── haskellch16.html │ │ ├── haskellch17.html │ │ ├── haskellch18.html │ │ ├── haskellch19.html │ │ ├── haskellch2.html │ │ ├── haskellch20.html │ │ ├── haskellch21.html │ │ ├── haskellch22.html │ │ ├── haskellch23.html │ │ ├── haskellch24.html │ │ ├── haskellch25.html │ │ ├── haskellch26.html │ │ ├── haskellch27.html │ │ ├── haskellch28.html │ │ ├── haskellch29.html │ │ ├── haskellch3.html │ │ ├── haskellch30.html │ │ ├── haskellch31.html │ │ ├── haskellch32.html │ │ ├── haskellch33.html │ │ ├── haskellch34.html │ │ ├── haskellch35.html │ │ ├── haskellch36.html │ │ ├── haskellch37.html │ │ ├── haskellch38.html │ │ ├── haskellch39.html │ │ ├── haskellch4.html │ │ ├── haskellch40.html │ │ ├── haskellch41.html │ │ ├── haskellch42.html │ │ ├── haskellch5.html │ │ ├── haskellch6.html │ │ ├── haskellch7.html │ │ ├── haskellch8.html │ │ ├── haskellch9.html │ │ ├── haskellli1.html │ │ ├── haskellli2.html │ │ ├── haskellli3.html │ │ ├── haskellpa1.html │ │ └── haskellpa2.html └── source │ ├── .gitignore │ ├── bower.json │ ├── gulpfile.js │ ├── package.json │ └── scss │ ├── _bootstrap.scss │ ├── _code.scss │ ├── _home.scss │ ├── _layout.scss │ ├── _typography.scss │ ├── _variables.scss │ └── hl.scss └── themes └── purple └── fonts ├── Haskell.dev.svg ├── Haskell.eot ├── Haskell.svg ├── Haskell.ttf └── Haskell.woff /.arcconfig: -------------------------------------------------------------------------------- 1 | { 2 | "project.name" : "hl", 3 | "repository.callsign" : "HL", 4 | "phabricator.uri" : "https://phabricator.haskell.org" 5 | } 6 | -------------------------------------------------------------------------------- /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((haskell-mode . ((haskell-process-type . cabal-repl) 2 | (haskell-process-use-ghci . t))) 3 | (css-mode . ((haskell-process-use-ghci . t)))) 4 | -------------------------------------------------------------------------------- /.ghci: -------------------------------------------------------------------------------- 1 | :set -isrc 2 | :set -fno-warn-unused-do-bind 3 | :set -DDEVELOPMENT=1 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.hi 3 | *~ 4 | dist/ 5 | cabal-dev/ 6 | .hsenv 7 | TAGS 8 | tags 9 | *.tag 10 | client_session_key.aes 11 | .cabal-sandbox 12 | hl.tar.gz 13 | .hsenv* 14 | cabal.sandbox.config 15 | /.stack-work/ 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, haskell-lang 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of haskell-lang nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Outdated Repository 2 | ===== 3 | You probably want the new repository at https://github.com/haskell-infra/www.haskell.org 4 | 5 | 6 | hl 7 | ===== 8 | 9 | Haskell.org web site. 10 | 11 | ## Editing pages 12 | 13 | If you're just here to contribute a content change, read this section. 14 | 15 | All pages that are produced by markdown 16 | [are here](https://github.com/haskell-infra/hl/tree/master/static/markdown). To 17 | contribute changes simply fork this repo and open a pull request. It 18 | will be merged and redeployed in short order. 19 | 20 | If you want to edit a page which has some custom code in it, you'll 21 | want to see the next sections for building and running 22 | instructions. Maybe also take a look at [architecture](#architecture). 23 | 24 | If you want to include Haskell code samples in markdown, use: 25 | 26 | ``` haskell 27 | main = putStrLn "Hello, World!" 28 | ``` 29 | 30 | If you want to include Haskell code samples in Haskell code pages, 31 | use: 32 | 33 | ``` haskell 34 | haskellPre "main = print 123" 35 | haskellCode "peyton `simon` jones" 36 | ``` 37 | 38 | Pre for `
` block, code for `` span snippet.
 39 | 
 40 | ## Building
 41 | 
 42 | Clone the repo:
 43 | 
 44 |     $ git clone git@github.com:haskell-infra/hl.git
 45 | 
 46 | Set up sandbox:
 47 | 
 48 |     $ cabal sandbox init
 49 | 
 50 | Install dependencies and build:
 51 | 
 52 |     $ cabal install --only-dependencies
 53 |     $ cabal build
 54 | 
 55 | Done!
 56 | 
 57 | ### CSS Assets
 58 | 
 59 | In `static/source`, run:
 60 | 
 61 |     $ npm install
 62 |     $ bower install
 63 | 
 64 | to install all the source libraries locally (you need [nodejs](https://nodejs.org) installed). Then:
 65 | 
 66 |     $ gulp css
 67 | 
 68 | to create a new CSS file (automatically creates a minified version as well).
 69 | 
 70 | ## Running
 71 | 
 72 | (Note: from within a development env where you run out of the dist folder, you want to ensure that `development` in src/HL/Development.hs is set to "True").
 73 | 
 74 | It runs at: http://localhost:1990/
 75 | 
 76 | Manually running the binary:
 77 | 
 78 |     $ dist/build/hl/hl
 79 | 
 80 | Running from inside GHCi:
 81 | 
 82 |     > :l DevelMain
 83 |     > DevelMain.update
 84 | 
 85 | Run this every time you want to update the web handler in-place, as in
 86 | [this demo](https://github.com/chrisdone/ghci-reload-demo).
 87 | 
 88 | If you use Emacs, you can just bind it to a key:
 89 | 
 90 | ``` lisp
 91 | (define-key html-mode-map [f12] 'haskell-process-reload-devel-main)
 92 | ```
 93 | 
 94 | Just hit f12 to recompile and restart.
 95 | 
 96 | ## Architecture
 97 | 
 98 | It uses Yesod and an MVC organization.
 99 | 
100 | * HL.Model.* -- [models](https://github.com/haskell-infra/hl/tree/master/src/HL/Model)
101 | * HL.View.* -- [views](https://github.com/haskell-infra/hl/tree/master/src/HL/View)
102 | * HL.Controller.* -- [controllers](https://github.com/haskell-infra/hl/tree/master/src/HL/Controller)
103 | 
104 | Templates are written in
105 | [Lucid](https://github.com/chrisdone/lucid). There is presently no
106 | database.
107 | 
108 | ## Style
109 | 
110 | We generally use
111 | [this style](https://github.com/chrisdone/haskell-style-guide)
112 | for this project. You don't have to use this style, we can reformat patches as
113 | they come in.
114 | 


--------------------------------------------------------------------------------
/Setup.hs:
--------------------------------------------------------------------------------
1 | import Distribution.Simple
2 | main = defaultMain
3 | 


--------------------------------------------------------------------------------
/config/routes:
--------------------------------------------------------------------------------
 1 | /static StaticR Static appStatic
 2 | / HomeR GET
 3 | /donate DonateR GET
 4 | /downloads DownloadsR GET
 5 | /downloads/#OS DownloadsForR GET
 6 | /community CommunityR GET
 7 | /irc IrcR GET
 8 | /mailing-lists MailingListsR GET
 9 | /documentation DocumentationR GET
10 | /news NewsR GET
11 | 


--------------------------------------------------------------------------------
/design/logo.svg:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  3 | 
  4 | 
 19 |   
 21 |     
 24 |       
 29 |     
 30 |     
 39 |     
 41 |       
 45 |       
 49 |     
 50 |     
 53 |       
 58 |     
 59 |     
 68 |     
 70 |       
 74 |       
 78 |     
 79 |     
 82 |       
 87 |     
 88 |     
 97 |   
 98 |   
120 |   
122 |     
123 |       
125 |         image/svg+xml
126 |         
128 |         
129 |       
130 |     
131 |   
132 |   
137 |     
142 |       
147 |     
148 |     
153 |       
158 |     
159 |     
164 |       
169 |     
170 |   
171 | 
172 | 


--------------------------------------------------------------------------------
/hl.cabal:
--------------------------------------------------------------------------------
 1 | name:                hl
 2 | version:             0.0.0
 3 | synopsis:            Haskell web site.
 4 | description:         Haskell web site.
 5 | license:             BSD3
 6 | license-file:        LICENSE
 7 | author:              Chris Done
 8 | maintainer:          chrisdone@gmail.com
 9 | copyright:           2014 Chris Done
10 | category:            Web
11 | build-type:          Simple
12 | cabal-version:       >=1.8
13 | data-files:          static/css/*.css
14 |                      static/css/*.min.css
15 |                      static/fonts/Haskell.dev.svg
16 |                      static/fonts/Haskell.eot
17 |                      static/fonts/Haskell.svg
18 |                      static/fonts/Haskell.ttf
19 |                      static/fonts/Haskell.woff
20 |                      static/fonts/glyphicons-halflings-regular.ttf
21 |                      static/fonts/glyphicons-halflings-regular.svg
22 |                      static/fonts/glyphicons-halflings-regular.eot
23 |                      static/fonts/glyphicons-halflings-regular.woff
24 |                      static/img/*.ico
25 |                      static/img/*.jpg
26 |                      static/img/*.png
27 |                      static/img/*.svg
28 |                      static/js/*.js
29 |                      static/js/*.min.js
30 |                      static/js/jquery.console.js
31 |                      static/js/jquery.cookie.js
32 |                      static/js/tryhaskell.pages.js
33 |                      static/js/warp.reload.js
34 |                      static/markdown/*.md
35 |                      static/report/haskell2010/*.css
36 |                      static/report/haskell2010/*.html
37 |                      static/report/haskell2010/*.png
38 | 
39 | executable hl
40 |   hs-source-dirs:    src/
41 |   ghc-options:       -Wall
42 |                      -O2
43 |                      -fno-warn-type-defaults
44 |   main-is:           Main.hs
45 |   build-depends:     base >= 4 && < 5
46 |                    , blaze-builder
47 |                    , blaze-html
48 |                    , blaze-markup
49 |                    , bytestring
50 |                    , conduit
51 |                    , conduit-extra
52 |                    , deepseq
53 |                    , directory
54 |                    , fast-logger
55 |                    , filepath
56 |                    , foreign-store
57 |                    , hscolour
58 |                    , http-conduit
59 |                    , lifted-base
60 |                    , lucid
61 |                    , markdown
62 |                    , monad-extras
63 |                    , mtl
64 |                    , pandoc > 1.17
65 |                    , pandoc-types
66 |                    , resourcet
67 |                    , spoon
68 |                    , tagstream-conduit
69 |                    , text
70 | --                   , text-icu
71 |                    , transformers
72 |                    , wai-logger
73 |                    , warp
74 |                    , xml-conduit
75 |                    , yesod
76 |                    , yesod-core
77 |                    , yesod-static
78 | 


--------------------------------------------------------------------------------
/hl.org:
--------------------------------------------------------------------------------
 1 | * Arguments against haskell.org
 2 | http://stackoverflow.com/questions/23848648/text-html-vs-blaze-html
 3 | * What do all existing language sites have?
 4 | ** A theme
 5 | ** Logo
 6 | ** Menu
 7 | *** Download
 8 | - Platform http://www.haskell.org/platform/
 9 | - GHC https://www.haskell.org/ghc/
10 | - Hackage http://hackage.haskell.org/
11 | *** Community
12 | *** Documentation
13 | *** News
14 | ** Visual things
15 | *** Opening paragraph
16 | **** Python
17 | Python is a programming language that lets you work quickly and
18 | integrate systems more effectively.
19 | **** Ruby
20 | Ruby is...
21 | A dynamic, open source programming language with a focus on simplicity
22 | and productivity. It has an elegant syntax that is natural to read and
23 | easy to write.
24 | **** Clojure
25 | Clojure is a dynamic programming language that targets the Java
26 | Virtual Machine (and the CLR, and JavaScript). It is designed to be a
27 | general-purpose language, combining the approachability and
28 | interactive development of a scripting language with an efficient and
29 | robust infrastructure for multithreaded programming. Clojure is a
30 | compiled language - it compiles directly to JVM bytecode, yet remains
31 | completely dynamic. Every feature supported by Clojure is supported at
32 | runtime. Clojure provides easy access to the Java frameworks, with
33 | optional type hints and type inference, to ensure that calls to Java
34 | can avoid reflection.
35 | **** F#
36 | F# is a mature, open source, cross-platform, functional-first
37 | programming language which empowers users and organizations to tackle
38 | complex computing problems with simple, maintainable and robust code.
39 | 
40 | F# runs on Linux, Mac OS X, Android, iOS, Windows as well as HTML5 and
41 | GPUs. F# is free to use and has an OSI-approved open source license.
42 | 
43 | F# is used in a wide range of application areas and is supported by
44 | both industry-leading companies providing professional tools, and by
45 | an active open community.
46 | 
47 | The F# Software Foundation exists to promote, protect, and advance F#,
48 | and to support and foster the growth of a diverse international
49 | community of F# users.
50 | **** Haskell.org
51 | Haskell is an advanced purely-functional programming language. An
52 | open-source product of more than twenty years of cutting-edge
53 | research, it allows rapid development of robust, concise, correct
54 | software. With strong support for integration with other languages,
55 | built-in concurrency and parallelism, debuggers, profilers, rich
56 | libraries and an active community, Haskell makes it easier to produce
57 | flexible, maintainable, high-quality software.
58 | **** Scala
59 | Have the best of both worlds. Construct elegant class hierarchies for
60 | maximum code reuse and extensibility, implement their behavior using
61 | higher-order functions. Or anything in-between.
62 | *** Code sample
63 | *** Thumbnails of videos
64 | *** Pictures of community stuff
65 | *** Screenshots
66 | *** Selling points
67 | - I like python.org's menu which shows Web Programming, GUI
68 |   Development, etc. and then next to each the library one would use
69 |   to accomplish that task.
70 | - Linux, OS X, Windows.
71 | *** News
72 | *** Twitter
73 | *** Supporters
74 | ** Other links
75 | *** Application areas / success stories
76 | *** Language options
77 | ** Footer with more links
78 | 


--------------------------------------------------------------------------------
/scripts/deploy:
--------------------------------------------------------------------------------
1 | #!/bin/bash -ex
2 | cabal build
3 | strip dist/build/hl/hl
4 | tar cvf hl.tar.gz dist/build/hl/hl scripts/restart static/ --lzma
5 | scp hl.tar.gz herz:
6 | ssh herz 'mkdir -p hl && cd hl && tar xvf ../hl.tar.gz --lzma && killall hl -w && rm ../hl.tar.gz'
7 | 


--------------------------------------------------------------------------------
/scripts/pull-build:
--------------------------------------------------------------------------------
1 | cabal update && cabal install .
2 | 


--------------------------------------------------------------------------------
/scripts/restart:
--------------------------------------------------------------------------------
1 | dist/build/hl/hl
2 | 


--------------------------------------------------------------------------------
/src/.dir-locals.el:
--------------------------------------------------------------------------------
1 | ((haskell-mode . ((haskell-process-use-ghci . t)
2 |                   (haskell-process-type . cabal-repl)
3 |                   (haskell-indent-spaces . 2))))
4 | 


--------------------------------------------------------------------------------
/src/Data/Conduit/List/TakeDrop.hs:
--------------------------------------------------------------------------------
 1 | -- | Take/drop tools.
 2 | 
 3 | module Data.Conduit.List.TakeDrop where
 4 | 
 5 | import Data.Conduit
 6 | import Prelude hiding (takeWhile,dropWhile)
 7 | 
 8 | -- | Take elements and yield them into upstream while the given
 9 | -- predicate holds, afterwards stop consuming.
10 | takeWhile :: Monad m => (a -> Bool) -> Conduit a m a
11 | takeWhile p =
12 |   do m <- await
13 |      case m of
14 |        Nothing -> return ()
15 |        Just x | p x -> do yield x
16 |                           takeWhile p
17 |               | otherwise -> return ()
18 | 
19 | -- | Consume elements and discard them until a given predicate holds,
20 | -- then yield everything following from upstream to downstream.
21 | dropWhile :: Monad m => (a -> Bool) -> Conduit a m a
22 | dropWhile p =
23 |   do m <- await
24 |      case m of
25 |        Nothing -> return ()
26 |        Just x | p x -> dropWhile p
27 |               | otherwise -> awaitForever yield
28 | 


--------------------------------------------------------------------------------
/src/Data/Conduit/TakeDrop.hs:
--------------------------------------------------------------------------------
 1 | -- | Take/drop tools.
 2 | 
 3 | module Data.Conduit.List.TakeDrop where
 4 | 
 5 | takeWhile :: Monad m => (a -> Bool) -> Conduit a m a
 6 | takeWhile p =
 7 |   do m <- await
 8 |      case m of
 9 |        Nothing -> return ()
10 |        Just x | p x -> do yield x
11 |                           takeWhile p
12 |               | otherwise -> return ()
13 | 
14 | 
15 | dropWhile :: Monad m => (a -> Bool) -> Conduit a m a
16 | dropWhile p =
17 |   do m <- await
18 |      case m of
19 |        Nothing -> return ()
20 |        Just x | p x -> dropWhile p
21 |               | otherwise -> awaitForever yield
22 | 


--------------------------------------------------------------------------------
/src/DevelMain.hs:
--------------------------------------------------------------------------------
 1 | -- | Devel web server.
 2 | 
 3 | module DevelMain where
 4 | 
 5 | import HL.Dispatch ()
 6 | import HL.Foundation
 7 | 
 8 | import Control.Concurrent
 9 | import Data.IORef
10 | import Foreign.Store
11 | import Network.Wai.Handler.Warp
12 | import System.Directory
13 | import System.Environment (getEnvironment)
14 | import System.FilePath
15 | import Yesod
16 | import Yesod.Static
17 | 
18 | -- | Start the web server.
19 | main :: IO (Store (IORef Application))
20 | main =
21 |   do st <- static "static"
22 |      tmpDir <- getTemporaryDirectory
23 |      let cacheDir = tmpDir  "hl-cache"
24 |      createDirectoryIfMissing True cacheDir
25 |      cacheVar <- newMVar cacheDir
26 |      app <- toWaiApp (App st cacheVar)
27 |      ref <- newIORef app
28 |      env <- getEnvironment
29 |      let port = maybe 1990 read $ lookup "PORT" env
30 |      tid <- forkIO
31 |               (runSettings
32 |                  (setPort port defaultSettings)
33 |                  (\req ->
34 |                     do handler <- readIORef ref
35 |                        handler req))
36 |      _ <- newStore tid
37 |      ref' <- newStore ref
38 |      _ <- newStore cacheVar
39 |      return ref'
40 | 
41 | -- | Update the server, start it if not running.
42 | update :: IO (Store (IORef Application))
43 | update =
44 |   do m <- lookupStore 1
45 |      case m of
46 |        Nothing -> main
47 |        Just store ->
48 |          do ref <- readStore store
49 |             cacheVar <- readStore (Store 2)
50 |             st <- static "static"
51 |             app <- toWaiApp (App st cacheVar)
52 |             writeIORef ref app
53 |             return store
54 | 


--------------------------------------------------------------------------------
/src/HL/Controller.hs:
--------------------------------------------------------------------------------
 1 | -- | Controller library.
 2 | 
 3 | module HL.Controller
 4 |   (module C
 5 |   ,App(..)
 6 |   ,C
 7 |   ,io)
 8 |   where
 9 | 
10 | import HL.Foundation (Handler)
11 | import HL.Foundation as C (Route(..))
12 | import HL.Types as C
13 | 
14 | import Control.Monad.Extra
15 | import Data.Text as C (Text)
16 | import Yesod as C hiding (Html,toHtml)
17 | import Yesod.Lucid as C
18 | 
19 | -- | Controller type.
20 | type C = Handler
21 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Community.hs:
--------------------------------------------------------------------------------
 1 | -- | Community page controller.
 2 | 
 3 | module HL.Controller.Community where
 4 | 
 5 | import HL.Controller
 6 | import HL.View.Community
 7 | import HL.View
 8 | 
 9 | -- | Community controller.
10 | getCommunityR :: C (Html ())
11 | getCommunityR = lucid communityV
12 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Documentation.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Documentation page controller.
 4 | 
 5 | module HL.Controller.Documentation where
 6 | 
 7 | import HL.Controller
 8 | import HL.View
 9 | import HL.View.Documentation
10 | 
11 | -- | Documentation controller.
12 | getDocumentationR :: C (Html ())
13 | getDocumentationR =
14 |   lucid documentationV
15 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Donate.hs:
--------------------------------------------------------------------------------
 1 | -- | Donate page controller.
 2 | 
 3 | module HL.Controller.Donate where
 4 | 
 5 | import HL.Controller
 6 | import HL.View.Donate
 7 | import HL.View
 8 | 
 9 | -- | Donate controller.
10 | getDonateR :: C (Html ())
11 | getDonateR = lucid donateV
12 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Downloads.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Downloads page controller.
 4 | 
 5 | module HL.Controller.Downloads where
 6 | 
 7 | import HL.Controller
 8 | import HL.Model.Markdown
 9 | import HL.View.Downloads
10 | import HL.View
11 | 
12 | -- | Downloads controller.
13 | getDownloadsR :: C (Html ())
14 | getDownloadsR = lucid . downloadsFromMarkdown =<< io (getMarkdown "downloads-main.md") --lucid downloadsV
15 | 
16 | -- | Downloads for particular OS.
17 | getDownloadsForR :: OS -> C (Html ())
18 | getDownloadsForR os =
19 |   do manualInstall <- io (getMarkdown "manual-install.md")
20 |      autoInstall <- io (getMarkdown autoFp)
21 |      lucid (downloadsForV os autoInstall manualInstall)
22 |   where autoFp =
23 |           case os of
24 |             Windows -> "windows-install.md"
25 |             OSX -> "osx-install.md"
26 |             Linux -> "linux-install.md"
27 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Home.hs:
--------------------------------------------------------------------------------
 1 | -- | Home page controller.
 2 | 
 3 | module HL.Controller.Home where
 4 | 
 5 | import HL.Controller
 6 | import HL.Model.Videos
 7 | import HL.View
 8 | import HL.View.Home
 9 | 
10 | -- | Home controller.
11 | getHomeR :: C (Html ())
12 | getHomeR =
13 |   do vids <- getHomeVideos
14 |      lucid (homeV vids)
15 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Irc.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | IRC channels.
 4 | 
 5 | module HL.Controller.Irc where
 6 | 
 7 | import HL.Controller
 8 | import HL.Controller.Markdown
 9 | import HL.View
10 | 
11 | -- | List IRC places.
12 | getIrcR :: C (Html ())
13 | getIrcR =
14 |   markdownPage [CommunityR,IrcR] "IRC Channels" "irc.md"
15 | 


--------------------------------------------------------------------------------
/src/HL/Controller/MailingLists.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Mailing lists page.
 4 | 
 5 | module HL.Controller.MailingLists where
 6 | 
 7 | import HL.Controller
 8 | import HL.Controller.Markdown
 9 | import HL.View
10 | 
11 | -- | Get mailing lists.
12 | getMailingListsR :: C (Html ())
13 | getMailingListsR =
14 |   markdownPage [CommunityR,MailingListsR]
15 |                "Mailing Lists"
16 |                "mailing-lists.md"
17 | 


--------------------------------------------------------------------------------
/src/HL/Controller/Markdown.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE BangPatterns #-}
 2 | 
 3 | -- | Get markdown templates.
 4 | 
 5 | module HL.Controller.Markdown where
 6 | 
 7 | import HL.Controller
 8 | import HL.Model.Markdown
 9 | import HL.View
10 | import HL.View.Markdown
11 | 
12 | -- | Render a simple markdown page.
13 | markdownPage :: [Route App] -> Text -> FilePath -> C (Html ())
14 | markdownPage crumbs t name =
15 |   do content <- io (getMarkdown name)
16 |      lucid (markdownV crumbs t content)
17 | 


--------------------------------------------------------------------------------
/src/HL/Controller/News.hs:
--------------------------------------------------------------------------------
 1 | -- | News page controller. This page simply downloads from
 2 | -- haskellnews.org which already has a pre-prepared page of news to
 3 | -- display.
 4 | 
 5 | module HL.Controller.News where
 6 | 
 7 | import HL.Controller
 8 | import HL.Model.News
 9 | import HL.View
10 | import HL.View.News
11 | 
12 | -- | News controller.
13 | getNewsR :: C (Html ())
14 | getNewsR =
15 |   do html <- io getHaskellNews
16 |      lucid (newsV html)
17 | 


--------------------------------------------------------------------------------
/src/HL/Development.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE CPP #-}
 2 | 
 3 | -- | Development?
 4 | 
 5 | module HL.Development where
 6 | 
 7 | development :: Bool
 8 | #ifdef DEVELOPMENT
 9 | development = True
10 | #else
11 | development = False
12 | #endif
13 | 


--------------------------------------------------------------------------------
/src/HL/Dispatch.hs:
--------------------------------------------------------------------------------
 1 | {-# OPTIONS -fno-warn-orphans -fno-warn-name-shadowing #-}
 2 | {-# LANGUAGE TemplateHaskell #-}
 3 | {-# LANGUAGE TypeSynonymInstances #-}
 4 | {-# LANGUAGE FlexibleInstances #-}
 5 | {-# LANGUAGE OverloadedStrings #-}
 6 | {-# LANGUAGE ViewPatterns #-}
 7 | 
 8 | -- | Make the dispatcher.
 9 | 
10 | module HL.Dispatch () where
11 | 
12 | import HL.Controller.Community
13 | import HL.Controller.Documentation
14 | import HL.Controller.Donate
15 | import HL.Controller.Downloads
16 | import HL.Controller.Home
17 | import HL.Controller.Irc
18 | import HL.Controller.MailingLists
19 | import HL.Controller.News
20 | import HL.Foundation
21 | import Yesod.Core.Dispatch
22 | 
23 | mkYesodDispatch "App" resourcesApp
24 | 


--------------------------------------------------------------------------------
/src/HL/Foundation.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE FlexibleInstances #-}
 2 | {-# OPTIONS -fno-warn-orphans #-}
 3 | {-# LANGUAGE TypeFamilies #-}
 4 | {-# LANGUAGE TemplateHaskell #-}
 5 | {-# LANGUAGE OverloadedStrings #-}
 6 | {-# LANGUAGE ViewPatterns #-}
 7 | {-# OPTIONS -fno-warn-name-shadowing #-}
 8 | 
 9 | -- | Yesod foundation.
10 | 
11 | module HL.Foundation
12 |   (module HL.Static
13 |   ,App(..)
14 |   ,Route(..)
15 |   ,Handler
16 |   ,Widget
17 |   ,resourcesApp
18 |   ,Slug(..)
19 |   ,Human(..)
20 |   ,Mode(..))
21 |   where
22 | 
23 | import Control.Concurrent.MVar.Lifted
24 | import HL.Static
25 | import HL.Types
26 | 
27 | import Data.Monoid
28 | import Network.Wai.Logger
29 | import System.Log.FastLogger
30 | import Yesod
31 | import Yesod.Caching
32 | import Yesod.Core.Types
33 | import Yesod.Slug
34 | import Yesod.Static
35 | 
36 | -- | Generate boilerplate.
37 | mkYesodData "App" $(parseRoutesFile "config/routes")
38 | 
39 | -- | Don't log anything to stdout.
40 | instance Yesod App where
41 |   makeLogger _ =
42 |     do set <- newFileLoggerSet 1000 "/dev/null"
43 |        (date,_) <- clockDateCacher
44 |        return (Logger {loggerSet = set
45 |                       ,loggerDate = date})
46 | 
47 | instance MonadCaching (HandlerT App IO) where
48 |   withCacheDir cont =
49 |     do dirVar <- fmap appCacheDir getYesod
50 |        withMVar dirVar cont
51 | 
52 | instance Human (Route App) where
53 |   toHuman r =
54 |     case r of
55 |       CommunityR           -> "Community"
56 |       IrcR                 -> "IRC"
57 |       DocumentationR       -> "Documentation"
58 |       HomeR                -> "Home"
59 |       DonateR              -> "Donate"
60 |       MailingListsR        -> "Mailing Lists"
61 |       NewsR                -> "News"
62 |       StaticR{}            -> "Static"
63 |       DownloadsR           -> "Downloads"
64 |       DownloadsForR os     -> "Downloads for " <> toHuman os
65 | 
66 | instance Slug (Route App) where
67 |   toSlug r =
68 |     case r of
69 |       CommunityR        -> "community"
70 |       IrcR              -> "irc"
71 |       DocumentationR    -> "documentation"
72 |       HomeR             -> "home"
73 |       DonateR           -> "donate"
74 |       MailingListsR     -> "mailing-lists"
75 |       NewsR             -> "news"
76 |       StaticR{}         -> "static"
77 |       DownloadsR        -> "downloads"
78 |       DownloadsForR{}   -> "downloads"
79 | 


--------------------------------------------------------------------------------
/src/HL/Model.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE DeriveFunctor #-}
 2 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 3 | 
 4 | -- | Model library.
 5 | 
 6 | module HL.Model where
 7 | 
 8 | import Control.Applicative
 9 | 
10 | -- | The model monad.
11 | newtype Model a = Model (IO a)
12 |   deriving (Monad,Functor,Applicative)
13 | 


--------------------------------------------------------------------------------
/src/HL/Model/Home.hs:
--------------------------------------------------------------------------------
 1 | -- | Model for the home page.
 2 | 
 3 | module HL.Model.Home where
 4 | 
 5 | videos =
 6 |   [("Functional Reactive Programming for Musical User Interfaces by Paul Hudak","http://vimeo.com/96744621","https://i.vimeocdn.com/video/476988542_150x84.jpg")
 7 |   ,("Conquering Hadoop with Haskell and Ozgun Ataman","http://vimeo.com/90189610","https://i.vimeocdn.com/video/469235326_150x84.jpg")
 8 |   ,("Using Lenses to Structure State with Nathan Bouscal","http://vimeo.com/90184695","https://i.vimeocdn.com/video/469227196_150x84.jpg")
 9 |   ,("GHCJS: Bringing Haskell to the Browser, by Luite Stegeman","http://vimeo.com/80895330","https://i.vimeocdn.com/video/456929997_150x84.jpg")]
10 | 


--------------------------------------------------------------------------------
/src/HL/Model/Markdown.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | {-# LANGUAGE BangPatterns #-}
 3 | 
 4 | -- | Markdown files.
 5 | 
 6 | module HL.Model.Markdown where
 7 | 
 8 | import           HL.Controller
 9 | 
10 | import           HL.View
11 | import           HL.View.Code
12 | 
13 | 
14 | import           Control.Exception
15 | import qualified Data.Text.IO as ST
16 | import qualified Data.Text.Lazy as L
17 | import           System.Directory
18 | import           System.FilePath
19 | import qualified Text.Blaze.Html5 as H
20 | import           Text.Blaze.Html.Renderer.Text (renderHtml)
21 | import           Text.Markdown
22 | 
23 | -- | Get the HTML for the given markdown static file.
24 | getMarkdown :: FilePath -> IO (Html ())
25 | getMarkdown name =
26 |   do dir <- getStaticDir
27 |      exists <- doesFileExist (dir  fp)
28 |      if exists
29 |         then do text <- fmap L.fromStrict (ST.readFile (dir  fp))
30 |                 let !html = renderHtml (markdown def { msBlockCodeRenderer = renderer } text)
31 |                 return (toHtmlRaw html)
32 |         else throw (MarkdownFileUnavailable name)
33 |   where fp = "markdown"  name
34 |         renderer lang (src,_) =
35 |           if lang == Just "haskell"
36 |              then H.preEscapedToHtml (renderText (haskellPre src))
37 |              else H.pre $ H.toHtml src
38 | 


--------------------------------------------------------------------------------
/src/HL/Model/News.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | {-# LANGUAGE ScopedTypeVariables #-}
 3 | 
 4 | -- | Get Haskell news.
 5 | 
 6 | module HL.Model.News where
 7 | 
 8 | import Lucid
 9 | 
10 | import Data.Text.Lazy.Encoding
11 | import Data.Text.Lazy (toStrict)
12 | import Network.HTTP.Conduit
13 | import Prelude hiding (readFile)
14 | 
15 | getHaskellNews :: IO (Html ())
16 | getHaskellNews =
17 |   do bytes <- simpleHttp "http://haskellnews.org/grouped?embeddable"
18 |      return (toHtmlRaw (toStrict (decodeUtf8 bytes)))
19 | 


--------------------------------------------------------------------------------
/src/HL/Model/Videos.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Model for videos.
 4 | 
 5 | module HL.Model.Videos
 6 |   (getHomeVideos)
 7 |   where
 8 | 
 9 | import Data.Text (Text)
10 | 
11 | -- | Get videos for the home page.
12 | getHomeVideos :: Monad m => m [(Text, Text, Text)]
13 | getHomeVideos =
14 |   return vids
15 | 
16 | -- | For now we manually encode them until I have time to think of a
17 | -- better way. This interface will be seamlessly replaceable with a
18 | -- config file or so (as far as the controller and view are
19 | -- concerned).
20 | vids :: [(Text,Text, Text)]
21 | vids =
22 |   [("Escape from the ivory tower: The Haskell journey, by Simon Peyton-Jones", "https://www.youtube.com/watch?v=re96UgMk6GQ", "https://i1.ytimg.com/vi/re96UgMk6GQ/mqdefault.jpg")
23 |   ,("Haskell taketh away: limiting side effects for parallel programming, by Ryan Newton", "https://www.youtube.com/watch?v=lC5UWG5N8oY", "https://i1.ytimg.com/vi/lC5UWG5N8oY/mqdefault.jpg")
24 |   ,("Production Haskell, by Reid Draper", "https://www.youtube.com/watch?v=AZQLkkDXy68", "https://i1.ytimg.com/vi/AZQLkkDXy68/mqdefault.jpg")
25 |   ,("Haskell Amuse-Bouche, by Mark Lentczner", "https://www.youtube.com/watch?v=b9FagOVqxmI", "https://i1.ytimg.com/vi/b9FagOVqxmI/mqdefault.jpg")
26 |   ,("Haskell is Not For Production and Other Tales, by Katie Miller", "https://www.youtube.com/watch?v=mlTO510zO78", "https://i1.ytimg.com/vi/mlTO510zO78/mqdefault.jpg")
27 |   ,("Your First Web Application with Spock, by Oskar Wickström", "https://www.youtube.com/watch?v=Orm-jIIgVD0", "https://i1.ytimg.com/vi/Orm-jIIgVD0/mqdefault.jpg")
28 |   ]
29 | 


--------------------------------------------------------------------------------
/src/HL/Static.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE TemplateHaskell #-}
 2 | 
 3 | -- | Static files.
 4 | 
 5 | module HL.Static where
 6 | 
 7 | import Control.Monad.IO.Class
 8 | import HL.Development
 9 | 
10 | import Paths_hl
11 | import Yesod.Static
12 | 
13 | staticFiles "static/"
14 | 
15 | -- | Get the directory for static files. In development returns the
16 | -- local copy, in production mode uses the Cabal data-files
17 | -- functionality.
18 | getStaticDir :: MonadIO m => m FilePath
19 | getStaticDir =
20 |   if development
21 |      then return "static/"
22 |      else liftIO (getDataFileName "static")
23 | 


--------------------------------------------------------------------------------
/src/HL/Types.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | {-# LANGUAGE DeriveDataTypeable #-}
 3 | 
 4 | -- | Side-wide datatypes.
 5 | 
 6 | module HL.Types where
 7 | 
 8 | import           Control.Concurrent.MVar
 9 | import           Control.Exception
10 | import           Data.Monoid
11 | import           Data.Text (Text)
12 | import qualified Data.Text as T
13 | import           Data.Typeable
14 | import           Yesod.Core.Dispatch
15 | import           Yesod.Slug
16 | import           Yesod.Static
17 | 
18 | -- | Make a human-readable version of the value.
19 | class Human a where
20 |   toHuman :: a -> Text
21 | 
22 | -- | A haskell-lang exception.
23 | data HaskellLangException
24 |   = MarkdownFileUnavailable !FilePath
25 |   | ReportPageNotFound !FilePath
26 |   deriving (Show,Typeable,Eq)
27 | 
28 | instance Exception HaskellLangException
29 | 
30 | -- | Application state.
31 | data App = App
32 |   { appStatic   :: !Static
33 |   , appCacheDir :: !(MVar FilePath)
34 |   }
35 | 
36 | -- | Operating system. Used for downloads, for example.
37 | data OS = Windows | OSX | Linux
38 |   deriving (Read,Show,Typeable,Eq,Enum,Bounded)
39 | 
40 | instance Slug OS where
41 |   toSlug o =
42 |     case o of
43 |       Windows -> "windows"
44 |       OSX     -> "osx"
45 |       Linux   -> "linux"
46 | 
47 | instance Human OS where
48 |   toHuman o =
49 |     case o of
50 |       Windows -> "Windows"
51 |       OSX     -> "OS X"
52 |       Linux   -> "Linux"
53 | 
54 | instance PathPiece OS where
55 |   toPathPiece = toSlug
56 |   fromPathPiece t =
57 |     case t of
58 |       "osx"     -> Just OSX
59 |       "windows" -> Just Windows
60 |       "linux"   -> Just Linux
61 |       _         -> Nothing
62 | 
63 | -- | Mode for rendering Haskell report.
64 | data Mode = Mono | Node
65 |   deriving (Eq,Show,Read)
66 | 
67 | instance Slug Mode where
68 |   toSlug m =
69 |     case m of
70 |       Mono -> "mono"
71 |       Node -> "node"
72 | 
73 | instance PathPiece Mode where
74 |   fromPathPiece m =
75 |     case m of
76 |       "mono" -> Just Mono
77 |       "node" -> Just Node
78 |       _ -> Nothing
79 |   toPathPiece = toSlug
80 | 
81 | -- | Page cache key.
82 | data PageKey = Report !Int
83 | 
84 | instance Slug PageKey where
85 |   toSlug (Report year) = "report-" <> T.pack (show year)
86 | 


--------------------------------------------------------------------------------
/src/HL/View.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | View library.
 4 | 
 5 | module HL.View
 6 |   (module HL.View
 7 |   ,module V)
 8 |   where
 9 | 
10 | import HL.Foundation as V (Route(..),App,Human(..),Slug(..))
11 | import HL.Static as V
12 | 
13 | import Control.Monad as V
14 | import Data.Text as V (Text)
15 | import Lucid as V
16 | import Lucid.Bootstrap as V
17 | import Yesod.Lucid as V
18 | 
19 | todo :: Term a r => a -> r
20 | todo = termWith "div" [class_ "muted"]
21 | 


--------------------------------------------------------------------------------
/src/HL/View/Code.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE FlexibleContexts #-}
 2 | {-# LANGUAGE OverloadedStrings #-}
 3 | {-# LANGUAGE ViewPatterns #-}
 4 | 
 5 | -- | Code highlighting.
 6 | 
 7 | module HL.View.Code where
 8 | 
 9 | import HL.View
10 | 
11 | import Data.Text (unpack)
12 | import Language.Haskell.HsColour.CSS (hscolour)
13 | 
14 | -- | Some syntax-highlighted code.
15 | haskellPre :: Text -> Html ()
16 | haskellPre = toHtmlRaw . hscolour False 1 . unpack
17 | 
18 | -- | Some syntax-highlighted code.
19 | rejectedHaskellPre :: Text -> Text -> Html ()
20 | rejectedHaskellPre msg =
21 |   wrap .
22 |   toHtmlRaw .
23 |   hscolour False 1 .
24 |   unpack
25 |   where wrap :: Html () -> Html ()
26 |         wrap inner =
27 |           div_ [class_ "rejected-code"]
28 |                (do span_ [class_ "rejected-note"]
29 |                          (toHtml msg)
30 |                    inner)
31 | 
32 | -- | Some syntax-highlighted code.
33 | haskellCode :: Text -> Html ()
34 | haskellCode = toHtmlRaw . preToCode . hscolour False 1 . unpack
35 | 
36 | -- | Convert a 
 tag code sample to .
37 | preToCode :: [Char] -> [Char]
38 | preToCode = codeEl . stripCPre . stripPre
39 |   where stripPre ('<':'p':'r':'e':'>':xs) = xs
40 |         stripPre xs = xs
41 |         stripCPre (reverse -> ('<':'/':'p':'r':'e':'>':xs)) = reverse xs
42 |         stripCPre xs = xs
43 |         codeEl xs = "" ++ xs ++ ""
44 | 


--------------------------------------------------------------------------------
/src/HL/View/Community.hs:
--------------------------------------------------------------------------------
  1 | {-# LANGUAGE OverloadedStrings #-}
  2 | {-# LANGUAGE NoImplicitPrelude #-}
  3 | 
  4 | -- | Community page view.
  5 | 
  6 | module HL.View.Community where
  7 | 
  8 | import HL.View
  9 | import HL.View.Template
 10 | 
 11 | -- | Community view.
 12 | communityV :: FromLucid App
 13 | communityV =
 14 |   template
 15 |     []
 16 |     "Community"
 17 |     (\url ->
 18 |        container_
 19 |          (row_
 20 |             (span12_ [class_ "col-sm-12"]
 21 |                (do h1_ "Community"
 22 |                    p_
 23 |                      "Haskellers interact, talk and collaborate across several mediums \
 24 |                      \and around the world. There are places to learn, to teach, to ask questions, and to find contributors and collaborators."
 25 |                    h2_ "Online Communities and Social Resources"
 26 |                    p_ "Haskellers are active on a number of online areas, but the most busy are below:"
 27 |                    ul_ (online url)
 28 |                    h2_ "In-person Groups and Meetups"
 29 |                    p_ "There are a number of Haskell Users groups where haskellers meet to learn and code. Some are listed below:"
 30 |                    ul_ offline
 31 |                    h2_ "Conferences and Events"
 32 |                    p_ "There are a number of conferences and events featuring Haskell, some focusing on the academic side of things, and some on the commercial or hobbyist side. Here are just a few:"
 33 |                    h3_ "Academic Conferences"
 34 |                    ul_ academicConferences
 35 |                    h3_ "Non-Academic Conferences"
 36 |                    ul_ commercialConferences
 37 |                    h3_ "Hackathons"
 38 |                    p_ "Haskell Hackathons are a long tradition, with lots of learning and social exchange. In many ways they function as semi-structured conferences. Here are some of the most notable:"
 39 |                    ul_ hackathons
 40 |                    h2_ "Specific Interest Groups"
 41 |                    ul_ sigs
 42 |                    h2_ ""))))
 43 | 
 44 | online :: (Route App -> Text) -> Html ()
 45 | online url =
 46 |   do li_ (a_ [href_ (url MailingListsR)] "The Haskell mailing lists")
 47 |      li_ (a_ [href_ (url IrcR)] "IRC (online chat)")
 48 |      li_ (a_ [href_ "http://stackoverflow.com/questions/tagged?tagnames=haskell"] "StackOverflow")
 49 |      li_ (a_ [href_ "https://plus.google.com/communities/104818126031270146189"] "Google+ community")
 50 |      li_ (a_ [href_ "https://www.facebook.com/groups/programming.haskell/"] "Facebook community")
 51 |      li_ (a_ [href_ "http://www.reddit.com/r/haskell"] "Reddit")
 52 |      li_ (a_ [href_ "http://www.haskell.org/haskellwiki/Haskell"] "Wiki")
 53 |      li_ (a_ [href_ "http://planet.haskell.org/"] "The blogosphere")
 54 |      li_ (a_ [href_ "https://haskellweekly.news/"] "Haskell Weekly e-mail newsletter")
 55 |      li_ (a_ [href_ "https://gitter.im/haskell-chat"] "Haskell Gitter Community Chat")
 56 |      li_ (a_ [href_ "https://wiki.haskell.org/Haskell_Communities_and_Activities_Report"] "Haskell Communities and Activities Report")
 57 | 
 58 | offline :: Html ()
 59 | offline =
 60 |   do li_ (a_ [href_ "http://www.meetup.com/ATX-Haskell/"] "Austin Haskell Users Group")
 61 |      li_ (a_ [href_ "http://www.meetup.com/Bay-Area-Haskell-Users-Group/"] "Bay Area Haskell Users Group")
 62 |      li_ (a_ [href_ "http://www.meetup.com/Boston-Haskell/"] "Boston Haskell")
 63 |      li_ (a_ [href_ "http://www.meetup.com/berlinhug/"] "Berlin Haskell Users Group")
 64 |      li_ (a_ [href_ "http://www.meetup.com/Brisbane-Functional-Programming-Group/"] "Brisbane Functional Programming Group")
 65 |      li_ (a_ [href_ "http://ChicagoHaskell.com/"] "Chicago Haskell")
 66 |      li_ (a_ [href_ "https://www.meetup.com/haskell-dublin-meetup/"] "Dublin Haskell Meetup")
 67 |      li_ (a_ [href_ "http://www.haskell-ita.it/"] "Italy Haskell Users Group")
 68 |      li_ (a_ [href_ "http://haskell.jp/"] "Japan Haskell Users Group (Haskell-jp)")
 69 |      li_ (a_ [href_ "http://www.meetup.com/NY-Haskell/"] "New York Haskell Users Group")
 70 |      li_ (a_ [href_ "http://www.meetup.com/London-Haskell/"] "London Haskell")
 71 |      li_ (a_ [href_ "http://seattlehaskell.org/"] "Seattle Area Haskell Users' Group (SeaHUG)")
 72 |      li_ (a_ [href_ "https://www.meetup.com/DelhiNCR-Haskell-And-Functional-Programming-Languages-Group/"] "Delhi NCR Haskell User Group")
 73 |      li_ (a_ [href_ "http://www.meetup.com/find/?allMeetups=true&keywords=Haskell&radius=Infinity"] "More Haskell meetups at meetup.com")
 74 | 
 75 | academicConferences :: Html ()
 76 | academicConferences =
 77 |   do li_ (a_ [href_ "https://www.haskell.org/haskell-symposium/"] "The Haskell Symposium")
 78 |      li_ (a_ [href_ "https://wiki.haskell.org/HaskellImplementorsWorkshop"] "Haskell Implementors' Workshop")
 79 |      li_ (a_ [href_ "http://www.icfpconference.org/"] "The International Conference on Functional Programming")
 80 |      li_ (a_ [href_ "http://popl.mpi-sws.org/"] "Symposium on Principles of Programming Languages")
 81 |      li_ (a_ [href_ "http://www.ifl-symposia.org/"] "International Symposia on Implementation and Application of Functional Languages")
 82 |      li_ (a_ [href_ "http://www.tifp.org/"] "Symposium on Trends in Functional Programming ")
 83 | 
 84 | commercialConferences :: Html ()
 85 | commercialConferences =
 86 |   do li_ (a_ [href_ "http://cufp.org/"] "Commercial Users of Functional Programming (Roving)")
 87 |      li_ (a_ [href_ "http://www.lambdajam.com/"] "LambdaJam (Chicago, IL, USA)")
 88 |      li_ (a_ [href_ "http://lambdajam.yowconference.com.au/"] "YOW! LambdaJam (Sydney, AU)")
 89 |      li_ (a_ [href_ "http://functionalconf.com/"] "Functional Conf (Bangalore, IN)")
 90 |      li_ (a_ [href_ "http://www.lambdacon.org/"] "LambdaCon (Bologna, IT)")
 91 |      li_ (a_ [href_ "http://bobkonf.de/"] "BOB (Berlin, DE)")
 92 |      li_ (a_ [href_ "http://www.iba-cg.de/hal9.html"] "HaL (Leipzig, Halle, DE)")
 93 |      li_ (a_ [href_ "https://skillsmatter.com/conferences/1907-haskell-exchange-2014"] "Skills Matter's Haskell eXchange (London, GB)")
 94 |      li_ (a_ [href_ "http://www.degoesconsulting.com/lambdaconf-2015/"] "LambdaConf (Boulder, CO, USA)")
 95 |      li_ (a_ [href_ "http://composeconference.org"] "Compose :: Conference (NY, NY, USA)")
 96 |      li_ (a_ [href_ "http://composeconference.org"] "Compose :: Melbourne (Melbourne, VIC, AU)")
 97 |      li_ (a_ [href_ "http://www.curry-on.org/"] "Curry On (Europe, roving)")
 98 |      li_ (a_ [href_ "https://lambdale.org/"] "LambdAle (London, GB)")
 99 | 
100 | hackathons :: Html ()
101 | hackathons =
102 |   do li_ (a_ [href_ "https://wiki.haskell.org/BayHac"] "BayHac (San Francisco Bay Area, CA, USA)")
103 |      li_ (a_ [href_ "https://wiki.haskell.org/Hac_Phi"] "Hac Phi (Philadelphia, PA, USA)")
104 |      li_ (a_ [href_ "https://wiki.haskell.org/ZuriHac"] "ZuriHac (Zurich, CH)")
105 |      li_ (a_ [href_ "https://wiki.haskell.org/HacFreiburg2017"] "HacFreiburg (Freiburg, De)")
106 | 
107 | sigs :: Html ()
108 | sigs =
109 |   do li_ (a_ [href_ "http://industry.haskell.org/"] "Industrial Haskell Group")
110 |      li_ (a_ [href_ "http://commercialhaskell.com/"] "Commercial Haskell Group")
111 |      li_ (a_ [href_ "http://www.datahaskell.org/"] "DataHaskell: data science, machine learning, numerical computation and related")
112 |      li_ (a_ [href_ "http://lurk.org/groups/haskell-art/"] "Haskell Art")
113 | 


--------------------------------------------------------------------------------
/src/HL/View/Documentation.hs:
--------------------------------------------------------------------------------
  1 | {-# LANGUAGE OverloadedStrings #-}
  2 | {-# LANGUAGE NoImplicitPrelude #-}
  3 | {-# OPTIONS -fno-warn-unused-do-bind #-}
  4 | 
  5 | -- | Documentation page view.
  6 | 
  7 | module HL.View.Documentation where
  8 | 
  9 | import HL.View
 10 | import HL.View.Template
 11 | 
 12 | -- | Documentation view.
 13 | documentationV :: FromLucid App
 14 | documentationV =
 15 |   template
 16 |     []
 17 |     "Documentation"
 18 |     (\url ->
 19 |        container_
 20 |          (row_
 21 |             (span12_ [class_ "col-sm-12"]
 22 |                (do h1_ "Documentation"
 23 |                    books
 24 |                    courses
 25 |                    tutorials
 26 |                    online
 27 |                    manuals
 28 |                    cabal
 29 |                    library
 30 |                    report url))))
 31 | 
 32 | books :: Html ()
 33 | books =
 34 |   do h2_ "Books for Learning Haskell"
 35 |      links bookLinks
 36 |   where
 37 |     bookLinks =
 38 |       [("Learn You a Haskell for Great Good!","http://learnyouahaskell.com/")
 39 |       ,("Real World Haskell","http://book.realworldhaskell.org/")
 40 |       ,("Haskell Programming from first principles","http://haskellbook.com")
 41 |       ,("Beginning Haskell","http://www.apress.com/9781430262503")
 42 |       ,("Thinking Functionally with Haskell","http://www.cambridge.org/us/academic/subjects/computer-science/programming-languages-and-applied-logic/thinking-functionally-haskell")
 43 |       ,("Parallel and Concurrent Programming in Haskell","http://chimera.labs.oreilly.com/books/1230000000929")
 44 |       ,("Programming in Haskell","http://www.cs.nott.ac.uk/~pszgmh/pih.html")
 45 |       ,("Haskell: The Craft of Functional Programming","http://www.haskellcraft.com/craft3e/Home.html")
 46 |       ,("The Haskell School of Music","http://haskell.cs.yale.edu/wp-content/uploads/2015/03/HSoM.pdf")
 47 |       ,("Developing Web Applications with Haskell and Yesod","http://www.yesodweb.com/book")
 48 |       ,("Get Programming with Haskell","https://www.manning.com/books/get-programming-with-haskell")]
 49 | 
 50 | courses :: Html ()
 51 | courses =
 52 |   do h2_ "Courses"
 53 |      p_ "Course material created by instructors"
 54 |      links courseLinks
 55 |   where
 56 |      courseLinks =
 57 |        [("University of Pennsylvania's CIS 194","https://www.seas.upenn.edu/~cis194/")
 58 |        ,("NICTA Functional Programming Course","https://github.com/NICTA/course")
 59 |        ,("University of Virginia's CS 1501","http://shuklan.com/haskell/")
 60 |        ,("Stanford's cs240h","http://www.scs.stanford.edu/14sp-cs240h/")
 61 |        ,("Hendrix's CSCI 360","http://ozark.hendrix.edu/~yorgey/360/f16/")]
 62 | 
 63 | tutorials :: Html ()
 64 | tutorials =
 65 |   do h2_ "Tutorials"
 66 |      p_ "Short, dense, classic ways to hit the ground running"
 67 |      links tutorialLinks
 68 |   where
 69 |     tutorialLinks =
 70 |        [("A Gentle Introduction to Haskell","https://www.haskell.org/tutorial/")
 71 |        ,("Happy Learn Haskell Tutorial","https://www.happylearnhaskelltutorial.com/")
 72 |        ,("Yet Another Haskell Tutorial","http://en.wikibooks.org/wiki/Haskell/YAHT/Preamble")
 73 |        ,("Write Yourself a Scheme in 48 Hours","http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours")
 74 |        ,("Write Yourself a Scheme 2.0","https://wespiser.com/writings/wyas/home.html")
 75 |        ,("Learning Haskell","http://learn.hfm.io")]
 76 | 
 77 | online :: Html ()
 78 | online =
 79 |   do h2_ "Online Resources"
 80 |      p_ "Curated resources put together by Haskellers:"
 81 |      links resources
 82 |   where
 83 |     resources =
 84 |       [("The Haskell Wiki","http://wiki.haskell.org")
 85 |       ,("The Haskell Wikibook","http://en.wikibooks.org/wiki/Haskell")
 86 |       ,("FP Complete's School of Haskell","https://www.fpcomplete.com/school")
 87 |       ,("Stephen Diehl's What I Wish I Knew When Learning Haskell","http://dev.stephendiehl.com/hask/#cabal")
 88 |       ,("Chris Allen's List of Learning Haskell Resources","https://github.com/bitemyapp/learnhaskell")
 89 |       ,("Bob Ippolito's Getting Started with Haskell","http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/")
 90 |       ,("Albert Y.C. Lai's Haskell Notes and Examples","http://www.vex.net/~trebla/haskell/index.xhtml")
 91 |       ,("Learning Haskell Resources on the Haskell Wiki","https://wiki.haskell.org/Learning_Haskell")]
 92 | 
 93 | manuals :: Html ()
 94 | manuals = do h2_ "Manuals and Guides"
 95 |              p_ "Manuals and guides that cover common Haskell tooling:"
 96 |              links tools
 97 |   where tools = [("GHC User Guide","http://www.haskell.org/ghc/docs/latest/html/users_guide/")
 98 |                 ,("Cabal Homepage And Quick Links","https://www.haskell.org/cabal/")
 99 |                 ,("Cabal User Guide","http://www.haskell.org/cabal/users-guide/")
100 |                 ,("Stack User Guide","https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md")
101 |                 ,("Haddock User Guide","http://www.haskell.org/haddock/doc/html/index.html")
102 |                 ,("Haskeleton: A Haskell Project Skeleton","http://taylor.fausak.me/2014/03/04/haskeleton-a-haskell-project-skeleton/")
103 |                 ,("How to Write a Haskell Program","https://wiki.haskell.org/How_to_write_a_Haskell_program")]
104 | 
105 | cabal :: Html ()
106 | cabal =
107 |   do h2_ "Package and Dependency Management"
108 |      p_ "The Cabal guide is a good start but there's a lot to learn:"
109 |      links cabalInfo
110 |   where cabalInfo =
111 |            [("Stephen Diehl's Cabal Quickstart","http://dev.stephendiehl.com/hask/#cabal")
112 |            ,("An Introduction to Cabal Sandboxes","http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html")
113 |            ,("The Storage and Interpretation of Cabal Packages","http://www.vex.net/~trebla/haskell/sicp.xhtml")
114 |            ,("The Cabal of Cabal","http://www.vex.net/~trebla/haskell/cabal-cabal.xhtml")]
115 | 
116 | library :: Html ()
117 | library =
118 |   do h2_ "Library Documentation"
119 |      p_ "Documentation for Haskell libraries is typically available on Hackage. We also have specialized tools for searching across it, not only by name, but by type."
120 |      links docs
121 |   where docs =
122 |          [("Hoogle API Search","http://www.haskell.org/hoogle/")
123 |          ,("FPComplete API Search", "https://www.fpcomplete.com/hoogle")
124 |          ,("Hayoo! API Search","http://hayoo.fh-wedel.de")
125 |          ,("Hackage","http://hackage.haskell.org/")
126 |          ,("The Typeclassopedia","https://wiki.haskell.org/Typeclassopedia")
127 |          ,("Haddocks for Libraries included with GHC","https://downloads.haskell.org/~ghc/latest/docs/html/libraries/index.html")]
128 | 
129 | report :: (Route App -> Text) -> Html ()
130 | report _ =
131 |   do h2_ "Language Report"
132 |      p_ (do "The Haskell 2010 language report is available online "
133 |             a_ [href_ "//haskell.org/onlinereport/haskell2010/"] "here"
134 |             ". ")
135 |      p_ (do "A PDF version is available "
136 |             a_ [href_ "//haskell.org/definition/haskell2010.pdf"] "here"
137 |             ".")
138 |      p_ "It can also be downloaded as a git repository: "
139 |      p_ (pre_ (code_ "$  git clone -b h2010 https://github.com/haskell/haskell-report"))
140 | 
141 | links :: [(Text,Text)] -> Html ()
142 | links items =
143 |   ul_ (forM_ items
144 |              (\(title,url) ->
145 |                 li_ (a_ [href_ url] (toHtml title))))
146 | 


--------------------------------------------------------------------------------
/src/HL/View/Donate.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | {-# LANGUAGE NoImplicitPrelude #-}
 3 | {-# LANGUAGE ExtendedDefaultRules #-}
 4 | 
 5 | -- | Community page view.
 6 | 
 7 | module HL.View.Donate where
 8 | 
 9 | import HL.View
10 | import HL.View.Template
11 | 
12 | import Lucid.Base
13 | 
14 | -- | Donation view.
15 | donateV :: FromLucid App
16 | donateV =
17 |   templateWithBodyEnder
18 |     []
19 |     "Donate to Haskell.org"
20 |     (\_ ->
21 |        do container_
22 |             (row_
23 |                (span12_
24 |                   (do h1_ "Make a donation to Haskell.org"
25 |                       p_
26 |                         "Using the form below, you can make a tax-deductible \
27 |                         \donation to Haskell.org."
28 |                       p_ (do "You can donate with any credit card, or using "
29 |                              a_ [href_ "https://bitcoin.org/en/"] "Bitcoin"
30 |                              ". You'll also need a valid email for a donation, but "
31 |                              "only for a receipt (if you want to stay anonymous, "
32 |                              "try a temporary random email from "
33 |                              a_ [href_ "http://maildrop.cc"] "maildrop.cc"
34 |                              ").")
35 |                       p_ (do "Your donations are processed by "
36 |                              a_ [href_ "https://stripe.com"] "Stripe"
37 |                              ", and granted to Haskell.org on behalf of "
38 |                              a_ [href_ "http://www.spi-inc.org/"] "Software in the Public Interest"
39 |                              ", a non-profit §501(c)3 registered in the state of New York.")
40 |                       p_ (do "Alternatively, you can donate to Haskell.org/SPI via "
41 |                              a_ [href_ "https://co.clickandpledge.com/advanced/default.aspx?wid=69561"] "Click & Pledge"
42 |                              ", a free online fundraising platform.")
43 |                       p_ donateForm
44 |                       p_ statusWindow))))
45 |     (\_ url -> do script_ [src_ "https://checkout.stripe.com/checkout.js"] ""
46 |                   script_ [src_ "https://donate.haskell.org/pubkey.js"] ""
47 |                   scripts url [js_donate_js])
48 | 
49 | donateForm :: Html ()
50 | donateForm =
51 |   form_ [class_ "form-inline"] (do
52 |     input_ [id_ "monies", type_ "number", class_ "input-large", placeholder_ "Amount in USD"]
53 |     " "
54 |     button_ [id_ "paybtn", class_ "btn btn-info", type_ "button"] "Donate")
55 | 
56 | statusWindow :: Html ()
57 | statusWindow =
58 |   div_ [ id_ "payment_status", class_ "alert alert-block fade", role'_ "alert" ] (do
59 |     button_ [ id_ "pay_status_close_btn", href_ "#", type_ "button"
60 |             , class_ "close" ] "x"
61 |     div_ [] (do
62 |       span_ [ id_ "status_glyph", class_ "glyphicon glyphicon-exclamation-sign"
63 |             , aria_hidden_ "true" ] ""
64 |       span_ [ id_ "status_title", class_ "sr-only" ] "Error:"
65 |       span_ [ id_ "status_message" ] "  Enter an amount above."))
66 | 
67 | role'_ :: Text -> Attribute
68 | role'_ = makeAttribute "role"
69 | 
70 | aria_hidden_ :: Text -> Attribute
71 | aria_hidden_ = makeAttribute "role"
72 | 


--------------------------------------------------------------------------------
/src/HL/View/Downloads.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Downloads page view.
 4 | 
 5 | module HL.View.Downloads where
 6 | 
 7 | import Data.Monoid
 8 | import HL.Types
 9 | import HL.View
10 | import HL.View.Template
11 | 
12 | downloadsFromMarkdown :: Html () -> FromLucid App
13 | downloadsFromMarkdown md =
14 |   template [] "Downloads"
15 |     (\_ -> container_ (row_  (span12_ [class_ "col-sm-12"]
16 |                                       (do h1_ (toHtml ("Downloads" :: String))
17 |                                           md))))
18 | 
19 | -- | OS-specific downloads view.
20 | downloadsForV :: OS -> Html () -> Html () -> FromLucid App
21 | downloadsForV os autoInstall manualInstall =
22 |   template
23 |     [DownloadsR
24 |     ,DownloadsForR os]
25 |     ("Downloads for " <> toHuman os)
26 |     (\_ ->
27 |        container_
28 |          (row_
29 |             (span12_ [class_ "col-sm-12"]
30 |                (do h1_ (toHtml ("Downloads for " <> toHuman os))
31 |                    autoInstall
32 |                    when (os == Linux)
33 |                         (do h2_ "Manual install"
34 |                             p_ "To install GHC and Cabal manually, follow these steps."
35 |                             manualInstall)))))
36 | 


--------------------------------------------------------------------------------
/src/HL/View/Home.hs:
--------------------------------------------------------------------------------
  1 | {-# LANGUAGE OverloadedStrings #-}
  2 | 
  3 | -- | Home/landing page.
  4 | 
  5 | module HL.View.Home where
  6 | 
  7 | import HL.View
  8 | import HL.View.Code
  9 | import HL.View.Home.Features
 10 | import HL.View.Template
 11 | 
 12 | -- | Home view.
 13 | homeV :: [(Text, Text, Text)] -> FromLucid App
 14 | homeV vids =
 15 |   skeleton
 16 |     "Haskell Language"
 17 |     (\_ _ -> return ())
 18 |     (\_cur url ->
 19 |        do navigation False [] Nothing url
 20 |           header url
 21 |           br_ []
 22 |           br_ [class_ "hidden-xs hidden-sm"]
 23 |           br_ [class_ "hidden-xs hidden-sm"]
 24 |           try url
 25 |           br_ []
 26 |           community url vids
 27 |           features
 28 |           br_ []
 29 |           sponsors
 30 |           transition
 31 |           events)
 32 |     (\_ url ->
 33 |        scripts url
 34 |                [js_jquery_console_js
 35 |                ,js_tryhaskell_js
 36 |                ,js_tryhaskell_pages_js])
 37 | 
 38 | -- | Top header section with the logo and code sample.
 39 | header :: (Route App -> Text) -> Html ()
 40 | header url =
 41 |   div_ [class_ "header"] $
 42 |   (container_
 43 |      (row_ (do span12_ [class_ "col-sm-12 hidden-xs"]
 44 |                        (br_ [])
 45 |                span6_ [class_ "col-md-6"]
 46 |                       (div_ [class_ "branding"]
 47 |                             (do branding
 48 |                                 summation))
 49 |                span6_ [class_ "col-md-6"]
 50 |                       (div_ [class_ "branding sample"]
 51 |                             (do tag
 52 |                                 sample)))))
 53 |   where branding = do br_ [class_ "hidden-xs"]
 54 |                       img_ [src_ (url (StaticR img_haskell_logo_svg)), class_ "img-responsive"]
 55 |         summation =
 56 |           h4_ [class_ "summary"] "An advanced, purely functional programming language"
 57 |         tag = do br_ [class_ "visible-xs visible-sm"]
 58 |                  h4_ [class_ "tag"] "Declarative, statically typed code."
 59 |         sample =
 60 |           div_ [class_ "code-sample",title_ "This example is contrived in order to demonstrate what Haskell looks like, including: (1) where syntax, (2) enumeration syntax, (3) pattern matching, (4) consing as an operator, (5) list comprehensions, (6) infix functions. Don't take it seriously as an efficient prime number generator."]
 61 |                (haskellPre codeSample)
 62 | 
 63 | -- | Code sample.
 64 | -- TODO: should be rotatable and link to some article.
 65 | codeSample :: Text
 66 | codeSample =
 67 |   "primes = filterPrime [2..] \n\
 68 |   \  where filterPrime (p:xs) = \n\
 69 |   \          p : filterPrime [x | x <- xs, x `mod` p /= 0]"
 70 | 
 71 | -- | Try Haskell section.
 72 | try :: (Route App -> Text) -> Html ()
 73 | try _ =
 74 |   div_ [class_ "pattern-bg"] $
 75 |     container_ $
 76 |       do row_ (span12_ [class_ "col-sm-12"]
 77 |                        (div_ [class_ "try",onclick_ "tryhaskell.controller.inner.click()"]
 78 |                              (container_
 79 |                                 (row_ (do span6_ [class_ "col-sm-6"] repl
 80 |                                           span6_ [class_ "col-sm-6",id_ "guide"] (return ())
 81 |                                       )))))
 82 | 
 83 |   where repl =
 84 |           do h2_ "Try it!"
 85 |              noscript_ (span6_ (div_ [class_ "alert alert-warning"]
 86 |                     "Try haskell requires Javascript to be enabled."))
 87 |              span6_ [hidden_ "", id_ "cookie-warning"]
 88 |                   (div_ [class_ "alert alert-warning"]
 89 |                   "Try haskell requires cookies to be enabled.")
 90 |              div_ [id_ "console"]
 91 |                   (return ())
 92 | 
 93 | -- | Community section.
 94 | -- TOOD: Should contain a list of thumbnail videos. See mockup.
 95 | community :: (Route App -> Text) -> [(Text, Text, Text)] -> Html ()
 96 | community _url vids =
 97 |   div_ [id_ "community-wrapper"]
 98 |        (do div_ [class_ "videos"]
 99 |                 (container_ (row_ (span12_ [class_ "col-sm-12"]
100 |                                            (do h2_ "Videos"
101 |                                                br_ []
102 |                                                row_ (span12_ [class_ "col-sm-12"]
103 |                                                              (row_ [class_ "row-flex"] (forM_ vids vid)))
104 |                                            )))))
105 |   where vid :: (Text,Text,Text) -> Html ()
106 |         vid (n,u,thumb) =
107 |           span3_ [class_ "col-xs-6 col-sm-3 col-md-2"]
108 |                  (a_ [class_ "thumbnail", href_ u, title_ n]
109 |                                     (do img_ [class_ "img-responsive", src_ thumb]
110 |                                         div_ [class_ "caption"]
111 |                                              (h5_ (toHtml (n :: Text)))))
112 | 
113 | -- | Information for people to help transition from the old site to the new locations.
114 | transition :: Html ()
115 | transition =
116 |   div_ [class_ "transition"]
117 |        (container_
118 |           (row_ (span6_ [class_ "col-sm-6"]
119 |                         (do br_ []
120 |                             h2_ "Psst! Looking for the wiki?"
121 |                             p_ (do "This is the new Haskell home page! The wiki has moved to "
122 |                                    a_ [href_ "https://wiki.haskell.org"] "wiki.haskell.org.")
123 |                             br_ []))))
124 | 
125 | -- | Events section.
126 | -- TODO: Take events section from Haskell News?
127 | events :: Html ()
128 | events =
129 |   return ()
130 | 
131 | -- | List of sponsors.
132 | sponsors :: Html ()
133 | sponsors =
134 |   div_ [class_ "sponsors pattern-bg"] $
135 |     container_ $
136 |       do row_ (span6_ [class_ "col-sm-6"] (h2_ "Sponsors"))
137 |          row_ (do span6_ [class_ "col-sm-6"]
138 |                          (p_ (do strong_ (a_ [href_ "https://www.datadoghq.com"] "DataDog")
139 |                                  " provides powerful, customizable 24/7 metrics and monitoring \
140 |                                  \integration for all of Haskell.org, and complains loudly for \
141 |                                  \us when things go wrong."))
142 |                   span6_ [class_ "col-sm-6"]
143 |                          (p_ (do strong_ (a_ [href_ "https://www.fastly.com"] "Fastly")
144 |                                  "'s Next Generation CDN provides low latency access for all of \
145 |                                  \Haskell.org's downloads and highest traffic services, including \
146 |                                  \the primary Hackage server, Haskell Platform downloads, and more." )))
147 |          row_ (do span6_ [class_ "col-sm-6"]
148 |                          (p_ (do strong_ (a_ [href_ "https://www.rackspace.com"] "Rackspace")
149 |                                  " provides compute, storage, and networking resources, powering \
150 |                                  \almost all of Haskell.org in several regions around the world."))
151 |                   span6_ [class_ "col-sm-6"]
152 |                          (p_ (do strong_ (a_ [href_ "https://www.status.io"] "Status.io")
153 |                                  " powers "
154 |                                  a_ [href_ "https://status.haskell.org"] "https://status.haskell.org"
155 |                                  ", and lets us easily tell you \
156 |                                  \when we broke something." )))
157 |          row_ (do span6_ [class_ "col-sm-6"]
158 |                          (p_ (do strong_ (a_ [href_ "http://www.galois.com"] "Galois")
159 |                                  " provides infrastructure, funds, administrative resources and \
160 |                                  \has historically hosted critical Haskell.org infrastructure, \
161 |                                  \as well as helping the Haskell community at large with their work." ))
162 |                   span6_ [class_ "col-sm-6"]
163 |                          (p_ (do strong_ (a_ [href_ "https://www.dreamhost.com"] "DreamHost")
164 |                                  " has teamed up to provide Haskell.org with redundant, scalable object-storage \
165 |                                  \through their Dream Objects service." )))
166 |          row_ (do span6_ [class_ "col-sm-6"]
167 |                          (p_ (do strong_ (a_ [href_ "https://webmon.com"] "Webmon")
168 |                                  " provides monitoring and escalation for core haskell.org infrastructure." )))
169 | 


--------------------------------------------------------------------------------
/src/HL/View/Markdown.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Simple markdown page view.
 4 | 
 5 | module HL.View.Markdown where
 6 | 
 7 | import HL.View
 8 | import HL.View.Template
 9 | 
10 | -- | Render a simple page.
11 | markdownV :: [Route App] -> Text -> Html () -> FromLucid App
12 | markdownV routes t inner =
13 |   template routes t (const (container_ (row_ (span12_ [class_ "col-sm-12"] inner))))
14 | 


--------------------------------------------------------------------------------
/src/HL/View/News.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | {-# LANGUAGE NoImplicitPrelude #-}
 3 | 
 4 | -- | News page view.
 5 | 
 6 | module HL.View.News where
 7 | 
 8 | import HL.View
 9 | import HL.View.Template
10 | 
11 | -- | News view.
12 | newsV :: Html () -> FromLucid App
13 | newsV inner =
14 |   template []
15 |            "News"
16 |            (\_ ->
17 |               container_
18 |                 (do row_ (span12_ [class_ "col-sm-12"] (do h1_ "News"))
19 |                     inner))
20 | 


--------------------------------------------------------------------------------
/src/HL/View/Template.hs:
--------------------------------------------------------------------------------
  1 | {-# LANGUAGE FlexibleInstances #-}
  2 | {-# LANGUAGE OverloadedStrings #-}
  3 | 
  4 | -- | Templates.
  5 | 
  6 | module HL.View.Template where
  7 | 
  8 | import HL.Types
  9 | import HL.View
 10 | 
 11 | import Data.Monoid
 12 | import Yesod.Static (Static)
 13 | 
 14 | -- | Render a template.
 15 | template
 16 |   :: [Route App]
 17 |   -> Text
 18 |   -> ((Route App -> Text) -> Html ())
 19 |   -> FromLucid App
 20 | template crumbs ptitle inner =
 21 |   templateWithBodyEnder crumbs
 22 |                         ptitle
 23 |                         inner
 24 |                         (\_ _ -> return ())
 25 | 
 26 | -- | Render a template, with some additional content just before
 27 | -- .
 28 | templateWithBodyEnder :: [Route App]
 29 |                       -> Text
 30 |                       -> ((Route App -> Text) -> Html ())
 31 |                       -> FromLucid App
 32 |                       -> FromLucid App
 33 | templateWithBodyEnder crumbs ptitle inner bodyender =
 34 |   skeleton ptitle
 35 |            (\_ _ -> return ())
 36 |            (\cur url ->
 37 |               div_ [class_ "template"]
 38 |                    (do navigation True crumbs cur url
 39 |                        container_ (bread url crumbs)
 40 |                        inner url))
 41 |            bodyender
 42 | 
 43 | -- | Render the basic site skeleton.
 44 | skeleton
 45 |   :: Text
 46 |   -> FromLucid App
 47 |   -> FromLucid App
 48 |   -> FromLucid App
 49 |   -> FromLucid App
 50 | skeleton ptitle innerhead innerbody bodyender mroute url =
 51 |   doctypehtml_
 52 |     (do head_ headinner
 53 |         body_ [class_ ("page-" <> toSlug route) | Just route <- [mroute]]
 54 |               (do bodyinner
 55 |                   analytics))
 56 |   where
 57 |     headinner =
 58 |       do title_ (toHtml ptitle)
 59 |          meta_ [charset_ "utf-8"]
 60 |          meta_ [httpEquiv_ "X-UA-Compatible",content_ "IE edge"]
 61 |          meta_ [name_ "viewport",content_ "width=device-width, initial-scale=1"]
 62 |          meta_ [name_ "keywords",content_ "haskell,functional,pure,programming,lazy"]
 63 |          meta_ [name_ "description",
 64 |                 content_ "The Haskell purely functional programming language home page."]
 65 |          link_ [rel_ "shortcut icon",href_ (url (StaticR img_favicon_ico))]
 66 |          linkcss "https://fonts.googleapis.com/css?family=Source+Sans+Pro|Raleway:700,900|Ubuntu+Mono:400"
 67 |          styles url
 68 |                 [StaticR css_hl_min_css]
 69 |          innerhead mroute url
 70 |     bodyinner =
 71 |       do div_ [class_ "wrap"] (innerbody mroute url)
 72 |          footer url mroute
 73 |          scripts url
 74 |                  [js_jquery_js
 75 |                  ,js_bootstrap_min_js
 76 |                  ,js_home_js]
 77 |          bodyender mroute url
 78 |     -- TODO: pop this in a config file later.
 79 |     analytics =
 80 |       script_ "var _gaq = _gaq || [];\n\
 81 |               \_gaq.push(['_setAccount', 'UA-83290513-1']);\n\
 82 |               \_gaq.push(['_trackPageview']);\n\
 83 |               \(function() {\n\
 84 |               \ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\
 85 |               \ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\
 86 |               \ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\
 87 |               \})();\n"
 88 | 
 89 | -- | Make a list of scripts.
 90 | scripts :: (Route App -> Text) -> [Route Static] -> Html ()
 91 | scripts url =
 92 |   mapM_ (\route ->
 93 |            script_ [src_ (url (StaticR route))] (mempty :: Text))
 94 | 
 95 | -- | Make a list of style links.
 96 | styles :: (a -> Text) -> [a] -> Html ()
 97 | styles url =
 98 |   mapM_ (\route ->
 99 |            linkcss (url route))
100 | 
101 | -- | A link to CSSxs
102 | linkcss :: Text -> Html ()
103 | linkcss uri =
104 |   link_ [rel_ "stylesheet",type_ "text/css",href_ uri]
105 | 
106 | -- | Main navigation.
107 | navigation :: Bool -> [Route App] -> FromLucid App
108 | navigation showBrand crumbs mroute url =
109 |   nav_ [class_ "navbar navbar-default"]
110 |       (div_ [class_ "container"]
111 |           (do div_ [class_ "navbar-header"]
112 |                    (do button_ [class_ "navbar-toggle collapsed", data_ "toggle" "collapse", data_ "target" "#haskell-menu"]
113 |                                (do span_ [class_ "sr-only"] ""
114 |                                    span_ [class_ "icon-bar"] ""
115 |                                    span_ [class_ "icon-bar"] ""
116 |                                    span_ [class_ "icon-bar"] "")
117 |                        when showBrand brand)
118 |               items))
119 |   where items =
120 |           div_ [class_ "collapse navbar-collapse", id_ "haskell-menu"]
121 |                (ul_ [class_ "nav navbar-nav navbar-right"]
122 |                     (mapM_ item [DownloadsR,CommunityR,DocumentationR,NewsR]))
123 |           where item :: Route App -> Html ()
124 |                 item route =
125 |                   li_ [class_ "active" | Just route == mroute || elem route crumbs]
126 |                       (a_ [href_ (url route)]
127 |                           (toHtml (toHuman route)))
128 |         brand = a_ [class_ "navbar-brand",href_ (url HomeR)]
129 |                    (do logo url)
130 | 
131 | -- | The logo character in the right font. Style it with an additional
132 | -- class or wrapper as you wish.
133 | logo :: (Route App -> Text) -> Html ()
134 | logo url = span_ [class_ "logo"] (do img_ [src_ (url (StaticR img_haskell_logo_svg))])
135 | 
136 | -- | Breadcrumb.
137 | bread :: (Route App -> Text) -> [Route App] -> Html ()
138 | bread url crumbs =
139 |   ol_ [class_ "breadcrumb"]
140 |       (forM_ crumbs
141 |              (\route ->
142 |                 li_ (a_ [href_ (url route)]
143 |                         (toHtml (toHuman route)))))
144 | 
145 | -- | Set the background image for an element.
146 | background :: (Route App -> Text) -> Route Static -> Attribute
147 | background url route =
148 |   style_ ("background-image: url(" <> url (StaticR route) <> ")")
149 | 
150 | -- | Footer across the whole site.
151 | footer :: (Route App -> Text) -> Maybe (Route App) -> Html ()
152 | footer url _r =
153 |   div_ [class_ "footer"]
154 |        (div_ [class_ "container"]
155 |              (p_ hlCopy))
156 |   where hlCopy =
157 |           do container_
158 |                        (row_ (do span3_ [class_ "col-sm-4 col-md-3"]
159 |                                         (span_ [class_ "item"] "\169 2014\8211\&2019 haskell.org")
160 |                                  span12_ [class_ "col-xs-12 visible-xs"] (br_ [])
161 |                                  span8_ [class_ "col-sm-4 col-md-6 text-center"]
162 |                                         (do br_ [class_ "visible-xs"]
163 |                                             span_ [class_ "item"] "Got changes to contribute to the site? "
164 |                                             br_ [class_ "visible-xs"]
165 |                                             a_ [href_ "https://github.com/haskell-infra/hl"] "Fork or comment on Github"
166 |                                             br_ [class_ "visible-xs"])
167 |                                  span12_ [class_ "col-xs-12 visible-xs"] (br_ [])
168 |                                  span3_ [class_ "col-sm-4 col-md-3 text-right"]
169 |                                         ((do span_ "Proudly hosted by "
170 |                                              a_ [href_ "https://www.rackspace.com/"]
171 |                                                 (img_ [src_ (url (StaticR img_rackspace_svg))
172 |                                                       ,alt_ "rackspace"
173 |                                                       ,height_ "20"
174 |                                                       ,width_ "20"])))
175 |                                  span12_ [class_ "col-sm-12"] (br_ [])
176 |                        ))
177 | 


--------------------------------------------------------------------------------
/src/Main.hs:
--------------------------------------------------------------------------------
 1 | -- | Web server.
 2 | 
 3 | module Main where
 4 | 
 5 | import Control.Concurrent.MVar
 6 | import HL.Dispatch ()
 7 | import HL.Foundation
 8 | import System.Directory
 9 | import System.Environment (getEnvironment)
10 | import System.FilePath
11 | import Yesod
12 | import Yesod.Static
13 | 
14 | -- | Main entry point.
15 | main :: IO ()
16 | main =
17 |   do dir <- getStaticDir
18 |      st <- static dir
19 |      tmpDir <- getTemporaryDirectory
20 |      let cacheDir = tmpDir  "hl-cache"
21 |      createDirectoryIfMissing True cacheDir
22 |      cacheVar <- newMVar cacheDir
23 |      env <- getEnvironment
24 |      let port = maybe 1990 read $ lookup "PORT" env
25 |      warp port (App st cacheVar)
26 | 


--------------------------------------------------------------------------------
/src/Text/Blaze/Bootstrap.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE OverloadedStrings #-}
 2 | 
 3 | -- | Bootstrap layout elements. See
 4 | --  for more
 5 | -- information.
 6 | 
 7 | module Text.Blaze.Bootstrap
 8 |  (
 9 |   -- * Containers
10 |   container
11 |  ,containerFluid
12 |  -- * Rows
13 |  ,row
14 |  ,rowFluid
15 |  -- * Spans
16 |  ,span1
17 |  ,span2
18 |  ,span3
19 |  ,span4
20 |  ,span5
21 |  ,span6
22 |  ,span7
23 |  ,span8
24 |  ,span9
25 |  ,span10
26 |  ,span11
27 |  ,span12
28 |  )
29 |   where
30 | 
31 | import Prelude hiding (div)
32 | import Text.Blaze.Html5
33 | import Text.Blaze.Extra
34 | 
35 | -- | A grid container.
36 | container :: Html -> Html
37 | container x = div !. "container" $ x
38 | 
39 | -- | A fluid grid container.
40 | containerFluid :: Html -> Html
41 | containerFluid x = div !. "container-fluid" $ x
42 | 
43 | -- | A grid row.
44 | row :: Html -> Html
45 | row x = div !. "row" $ x
46 | 
47 | -- | A fluid grid row.
48 | rowFluid :: Html -> Html
49 | rowFluid x = div !. "row-fluid" $ x
50 | 
51 | span1 :: Html -> Html
52 | span1 = div !. "span1 col-md-1"
53 | 
54 | span2 :: Html -> Html
55 | span2 = div !. "span2 col-md-2"
56 | 
57 | span3 :: Html -> Html
58 | span3 = div !. "span3 col-md-3"
59 | 
60 | span4 :: Html -> Html
61 | span4 = div !. "span4 col-md-4"
62 | 
63 | span5 :: Html -> Html
64 | span5 = div !. "span5 col-md-5"
65 | 
66 | span6 :: Html -> Html
67 | span6 = div !. "span6 col-md-6"
68 | 
69 | span7 :: Html -> Html
70 | span7 = div !. "span7 col-md-7"
71 | 
72 | span8 :: Html -> Html
73 | span8 = div !. "span8 col-md-8"
74 | 
75 | span9 :: Html -> Html
76 | span9 = div !. "span9 col-md-9"
77 | 
78 | span10 :: Html -> Html
79 | span10 = div !. "span10 col-md-10"
80 | 
81 | span11 :: Html -> Html
82 | span11 = div !. "span11 col-md-11"
83 | 
84 | span12 :: Html -> Html
85 | span12 = div !. "span12 col-md-12"
86 | 


--------------------------------------------------------------------------------
/src/Text/Blaze/Extra.hs:
--------------------------------------------------------------------------------
 1 | -- | Extra combinators for blaze.
 2 | 
 3 | module Text.Blaze.Extra where
 4 | 
 5 | 
 6 | import           Text.Blaze
 7 | 
 8 | import qualified Text.Blaze.Html5.Attributes as A
 9 | 
10 | import           Text.Blaze.Internal (Attributable)
11 | 
12 | -- | Class attribute.
13 | (!.) :: (Attributable h) => h -> AttributeValue -> h
14 | e !. className = e ! A.class_ className
15 | 
16 | -- | Id attribute.
17 | (!#) :: (Attributable h) => h -> AttributeValue -> h
18 | e !# idName = e ! A.id idName
19 | 


--------------------------------------------------------------------------------
/src/Yesod/Caching.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE FlexibleContexts #-}
 2 | -- | Support for caching pages.
 3 | 
 4 | module Yesod.Caching
 5 |   (MonadCaching(..)
 6 |   ,caching)
 7 |   where
 8 | 
 9 | import           Blaze.ByteString.Builder
10 | import           Control.Monad
11 | import           Control.Monad.IO.Class
12 | import           Control.Monad.Trans.Resource
13 | import qualified Data.ByteString.Lazy as L
14 | import           Data.Conduit (($$),($=),Flush(..),await,yield,ConduitM)
15 | import           Data.Conduit.Binary (sinkFile)
16 | import           Data.Conduit.Blaze
17 | import qualified Data.Text as T
18 | import           System.Directory
19 | import           System.FilePath
20 | import           Yesod.Core
21 | import           Yesod.Slug
22 | 
23 | -- | Monad which contains a cache directory to which things can be
24 | -- read and wrote. The 'withCacheDir' may implement a mutual exclusion
25 | -- on this resource.
26 | class (MonadIO m,MonadBaseControl IO m) => MonadCaching m where
27 |   withCacheDir :: (FilePath -> m a) -> m a
28 | 
29 | -- | With the given key run the given action, caching any content
30 | -- builders.
31 | caching :: (Slug key,HasContentType content,MonadCaching m)
32 |         => key -> m content -> m TypedContent
33 | caching key handler =
34 |   withCacheDir
35 |     (\dir ->
36 |        do let fp =
37 |                 dir 
38 |                 T.unpack (toSlug key)
39 |           exists <- liftIO (doesFileExist fp)
40 |           if exists
41 |              then return (TypedContent (getContentType handler)
42 |                                        (ContentFile fp Nothing))
43 |              else do candidate <-
44 |                        liftM toContent handler
45 |                      invalidated handler fp candidate)
46 | 
47 | -- | Cache is non-existent or invalidated, time to run the user action
48 | -- and store the result.
49 | invalidated :: (HasContentType content,MonadIO m)
50 |    => m content -> FilePath -> Content -> m TypedContent
51 | invalidated handler fp content =
52 |   case content of
53 |     ContentBuilder builder mlen ->
54 |       do liftIO (L.writeFile
55 |                    fp
56 |                    (maybe id
57 |                           (L.take . fromIntegral)
58 |                           mlen
59 |                           (toLazyByteString builder)))
60 |          continue
61 |     ContentSource src ->
62 |       do liftIO (runResourceT
63 |                    (src $= builderToByteStringFlush $=
64 |                     yieldChunks $$ sinkFile fp))
65 |          continue
66 |     ContentDontEvaluate c -> invalidated handler fp c
67 |     _ -> continue
68 |   where continue =
69 |           return (TypedContent (getContentType handler)
70 |                                content)
71 | 
72 | -- | Yield all the chunks.
73 | yieldChunks :: ConduitM (Flush o) o (ResourceT IO) ()
74 | yieldChunks =
75 |   do ma <- await
76 |      case ma of
77 |        Nothing -> return ()
78 |        Just Flush -> yieldChunks
79 |        Just (Chunk a) ->
80 |          do yield a
81 |             yieldChunks
82 | 


--------------------------------------------------------------------------------
/src/Yesod/Lucid.hs:
--------------------------------------------------------------------------------
 1 | {-# LANGUAGE TypeSynonymInstances #-}
 2 | {-# LANGUAGE FlexibleInstances #-}
 3 | {-# LANGUAGE OverloadedStrings #-}
 4 | {-# OPTIONS_GHC -fno-warn-orphans #-}
 5 | 
 6 | -- | Useful utilities for using Lucid with Yesod.
 7 | 
 8 | module Yesod.Lucid
 9 |   (module Yesod.Lucid
10 |   ,module Yesod)
11 |   where
12 | 
13 | import           Control.Monad.Identity
14 | import           Data.Text (Text)
15 | import           Lucid
16 | import           Yesod (ToTypedContent, MonadHandler, ToContent, Route, HandlerSite,
17 |                         TypedContent, HasContentType(..))
18 | import qualified Yesod as Y
19 | 
20 | -- | A lucid generator.
21 | type FromLucid a =
22 |   Maybe (Route a) ->
23 |   (Route a -> Text) ->
24 |   Html ()
25 | 
26 | -- | Output some lucid, passes a URL renderer to the continuation.
27 | lucid :: MonadHandler m => FromLucid (HandlerSite m) -> m (Html ())
28 | lucid cont =
29 |   do render <- Y.getUrlRender
30 |      route <- Y.getCurrentRoute
31 |      return
32 |        (cont route render)
33 | 
34 | instance ToTypedContent (Html ()) where
35 |   toTypedContent m =
36 |     Y.TypedContent (getContentType (Just m))
37 |     (Y.toContent m)
38 | 
39 | instance ToContent (Html ()) where
40 |   toContent html =
41 |     Y.ContentBuilder (runIdentity (execHtmlT html))
42 |                      Nothing
43 | 
44 | instance HasContentType (Html ()) where
45 |   getContentType _ = "text/html"
46 | 


--------------------------------------------------------------------------------
/src/Yesod/Slug.hs:
--------------------------------------------------------------------------------
 1 | -- | Make a slug.
 2 | 
 3 | module Yesod.Slug (Slug(..)) where
 4 | 
 5 | import Data.Text (Text)
 6 | 
 7 | -- | Make a slug version of the value.
 8 | class Slug a where
 9 |   toSlug :: a -> Text
10 | 


--------------------------------------------------------------------------------
/stack.yaml:
--------------------------------------------------------------------------------
1 | resolver: lts-6.30
2 | 


--------------------------------------------------------------------------------
/static/fonts/Haskell.dev.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
 5 | This is a custom SVG font generated by IcoMoon.
 6 | 
 7 | 
 8 | 
 9 | 
10 | 
11 | 
12 | 
13 | 
14 | 
15 | 


--------------------------------------------------------------------------------
/static/fonts/Haskell.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/fonts/Haskell.eot


--------------------------------------------------------------------------------
/static/fonts/Haskell.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
 5 | This is a custom SVG font generated by IcoMoon.
 6 | 
 7 | 
 8 | 
 9 | 
10 | 
11 | 
12 | 
13 | 
14 | 
15 | 


--------------------------------------------------------------------------------
/static/fonts/Haskell.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/fonts/Haskell.ttf


--------------------------------------------------------------------------------
/static/fonts/Haskell.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/fonts/Haskell.woff


--------------------------------------------------------------------------------
/static/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/fonts/glyphicons-halflings-regular.eot


--------------------------------------------------------------------------------
/static/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/fonts/glyphicons-halflings-regular.ttf


--------------------------------------------------------------------------------
/static/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/fonts/glyphicons-halflings-regular.woff


--------------------------------------------------------------------------------
/static/img/community.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/img/community.jpg


--------------------------------------------------------------------------------
/static/img/community.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/img/community.png


--------------------------------------------------------------------------------
/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/img/favicon.ico


--------------------------------------------------------------------------------
/static/img/haskell-logo.svg:
--------------------------------------------------------------------------------
1 | 
2 | 


--------------------------------------------------------------------------------
/static/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/img/logo.png


--------------------------------------------------------------------------------
/static/img/pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/img/pattern.png


--------------------------------------------------------------------------------
/static/img/rackspace.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |  
 4 |   
 5 |    
 6 |     image/svg+xml
 7 |     
 8 |     
 9 |    
10 |   
11 |  
12 |  
13 |   
14 |   
15 |  
16 | 
17 | 


--------------------------------------------------------------------------------
/static/js/donate.js:
--------------------------------------------------------------------------------
  1 | // -- Logging ------------------------------------------------------------------
  2 | 
  3 | function donate_onoes(s)
  4 | {
  5 |   $('#payment_status').removeClass('in'); // fade out if necessary
  6 |   $('#payment_status').removeClass('alert-success').addClass('alert-danger');
  7 |   $('#status_glyph').removeClass('glyphicon-ok-sign').addClass('glyphicon-exclamation-sign');
  8 |   $('#status_title').html('Error:')
  9 |   $('#status_message').html("  "+s);
 10 |   $('#payment_status').addClass('in');
 11 |   return null;
 12 | }
 13 | 
 14 | function donate_ogood(s)
 15 | {
 16 |   $('#payment_status').removeClass('in'); // fade out if necessary
 17 |   $('#payment_status').removeClass('alert-danger').addClass('alert-success');
 18 |   $('#status_glyph').removeClass('glyphicon-exclamation-sign').addClass('glyphicon-ok-sign');
 19 |   $('#status_title').html('Success:')
 20 |   $('#status_message').html("  "+s);
 21 |   $('#payment_status').addClass('in');
 22 |   return null;
 23 | }
 24 | 
 25 | // hide alert when button is clicked
 26 | $(function() {
 27 |   $('#pay_status_close_btn').click(function () {
 28 |     $('#payment_status').removeClass('in');
 29 |   });
 30 | });
 31 | 
 32 | // -- Dealing with $$$ ---------------------------------------------------------
 33 | 
 34 | function disableDonateButton()
 35 | {
 36 |   $('#paybtn').addClass('disabled');
 37 |   $('#paybtn').html(" Working...");
 38 | }
 39 | 
 40 | function enableDonateButton()
 41 | {
 42 |   $('#paybtn').html('Donate');
 43 |   $('#paybtn').removeClass('disabled');
 44 | }
 45 | 
 46 | function validateDonationAmnt()
 47 | {
 48 |   var amnt = $.trim($('#monies').val());
 49 |   if (amnt.length == 0) return donate_onoes("You must enter a valid amount of money.");
 50 | 
 51 |   var match = /^(\d*)(?:\.(\d{1,2}))?$/.exec(amnt);
 52 |   if (!match) return donate_onoes("Invalid amount: " + amnt);
 53 | 
 54 |   // Normalize input. If there's no leading zero before the decimal,
 55 |   // then there's no dollars. If you put in '23.3' you want 2330, not
 56 |   // 2303.
 57 |   var r1 = match[1]; var r2 = match[2];
 58 |   if (r1 == null || r1.length == 0) r1 = "0";
 59 |   if (r2 != null && r2.length == 1) r2 += "0";
 60 | 
 61 |   var dolla = parseInt(r1, 10),
 62 |       cents = parseInt(r2 || "0", 10);
 63 |       total = (dolla * 100) + cents;
 64 |   if (total < 50) return donate_onoes("Minimum charge is 50 cents!");
 65 |   return total;
 66 | }
 67 | 
 68 | function chargeCard(token)
 69 | {
 70 |   var amnt = validateDonationAmnt();
 71 |   if (amnt == null) return;
 72 |   disableDonateButton();
 73 | 
 74 |   var params = {};
 75 |   params.amount = amnt;
 76 |   params.token  = token.id;
 77 |   params.email  = token.email;
 78 | 
 79 |   $.post('https://donate.haskell.org/charge', params,
 80 |     // Success
 81 |     function () {
 82 |       var date = new Date();
 83 |       donate_ogood("" + date.toUTCString() + ": "
 84 |                  + "Your donation was successful -- thank you!");
 85 |       enableDonateButton();
 86 |     }).fail(
 87 |     // Failure
 88 |     function(xhr, status) {
 89 |       var err;
 90 |       try {
 91 |         err = JSON.parse(xhr.responseText).message;
 92 |       } catch (x) {
 93 |         err = "Unknown error. :(";
 94 |       }
 95 |       donate_onoes("Payment failed. Reason: " + err + "");
 96 |       enableDonateButton();
 97 |     });
 98 | }
 99 | 
100 | 
101 | // -- Entry point --------------------------------------------------------------
102 | 
103 | var stripeDonateHandler = StripeCheckout.configure({
104 |   key:             haskell_stripe_pubkey,
105 |   name:            'Donate to Haskell.org',
106 |   description:     "Because you're awesome!",
107 |   panelLabel:      'Donate {{amount}}',
108 |   currency:        'usd',
109 |   allowRememberMe: false,
110 |   bitcoin:         true,
111 |   token:           chargeCard,
112 | });
113 | 
114 | // Close Checkout on page navigation
115 | $(function() {
116 |   $(window).on('popstate', function() {
117 |     stripeDonateHandler.close();
118 |   });
119 | });
120 | 
121 | $(function() {
122 |   $('#paybtn').click(function (e) {
123 |     var amnt = validateDonationAmnt();
124 |     if (amnt == null) return;
125 | 
126 |     stripeDonateHandler.open({
127 |       amount:      amnt,
128 |     });
129 |     e.preventDefault();
130 |   });
131 | });
132 | 
133 | // Local Variables:
134 | // fill-column: 80
135 | // indent-tabs-mode: nil
136 | // js-indent-level: 2
137 | // buffer-file-coding-system: utf-8-unix
138 | // End:
139 | 


--------------------------------------------------------------------------------
/static/js/highlight.pack.js:
--------------------------------------------------------------------------------
1 | !function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,"")}),n.filter(function(e){return N(e)||/no(-?)highlight/.test(e)})[0]}function o(e,n){var t={};for(var r in e)t[r]=e[r];if(n)for(var r in n)t[r]=n[r];return t}function i(e){var n=[];return function r(e,a){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?a+=o.nodeValue.length:1==o.nodeType&&(n.push({event:"start",offset:a,node:o}),a=r(o,a),t(o).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:o}));return a}(e,0),n}function c(e,r,a){function o(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function c(e){l+=""}function u(e){("start"==e.event?i:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=o();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=o();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(i)}else"start"==g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function u(e){function n(e){return e&&e.source||e}function t(t,r){return RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");c[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):Object.keys(a.k).forEach(function(e){u(e,a.k[e])}),a.k=c}a.lR=t(a.l||/\b[A-Za-z0-9_]+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,o){function i(e,n){for(var t=0;t";return o+=e+'">',o+n+i}function d(){if(!w.k)return n(y);var e="",t=0;w.lR.lastIndex=0;for(var r=w.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(w,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=w.lR.lastIndex,r=w.lR.exec(y)}return e+n(y.substr(t))}function h(){if(w.sL&&!R[w.sL])return n(y);var e=w.sL?s(w.sL,y,!0,L[w.sL]):l(y);return w.r>0&&(B+=e.r),"continuous"==w.subLanguageMode&&(L[w.sL]=e.top),p(e.language,e.value,!1,!0)}function v(){return void 0!==w.sL?h():d()}function b(e,t){var r=e.cN?p(e.cN,"",!0):"";e.rB?(M+=r,y=""):e.eB?(M+=n(t)+r,y=""):(M+=r,y=t),w=Object.create(e,{parent:{value:w}})}function m(e,t){if(y+=e,void 0===t)return M+=v(),0;var r=i(t,w);if(r)return M+=v(),b(r,t),r.rB?0:t.length;var a=c(w,t);if(a){var o=w;o.rE||o.eE||(y+=t),M+=v();do w.cN&&(M+=""),B+=w.r,w=w.parent;while(w!=a.parent);return o.eE&&(M+=n(t)),y="",a.starts&&b(a.starts,""),o.rE?0:t.length}if(f(t,w))throw new Error('Illegal lexeme "'+t+'" for mode "'+(w.cN||"")+'"');return y+=t,t.length||1}var x=N(e);if(!x)throw new Error('Unknown language: "'+e+'"');u(x);for(var w=o||x,L={},M="",k=w;k!=x;k=k.parent)k.cN&&(M=p(k.cN,"",!0)+M);var y="",B=0;try{for(var C,j,I=0;;){if(w.t.lastIndex=I,C=w.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}m(t.substr(I));for(var k=w;k.parent;k=k.parent)k.cN&&(M+="");return{r:B,value:M,language:e,top:w}}catch(A){if(-1!=A.message.indexOf("Illegal"))return{r:0,value:n(t)};throw A}}function l(e,t){t=t||E.languages||Object.keys(R);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return E.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,E.tabReplace)})),E.useBR&&(e=e.replace(/\n/g,"
")),e}function g(e,n,t){var r=n?x[n]:t,a=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||a.push("hljs"),r&&a.push(r),a.join(" ").trim()}function p(e){var n=a(e);if(!/no(-?)highlight/.test(n)){var t;E.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,o=n?s(n,r,!0):l(r),u=i(t);if(u.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(u,i(p),r)}o.value=f(o.value),e.innerHTML=o.value,e.className=g(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){E=o(E,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",h,!1),addEventListener("load",h,!1)}function b(n,t){var r=R[n]=t(e);r.aliases&&r.aliases.forEach(function(e){x[e]=n})}function m(){return Object.keys(R)}function N(e){return R[e]||R[x[e]]}var E={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},R={},x={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=v,e.registerLanguage=b,e.listLanguages=m,e.getLanguage=N,e.inherit=o,e.IR="[a-zA-Z][a-zA-Z0-9_]*",e.UIR="[a-zA-Z_][a-zA-Z0-9_]*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.CLCM={cN:"comment",b:"//",e:"$",c:[e.PWM]},e.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[e.PWM]},e.HCM={cN:"comment",b:"#",e:"$",c:[e.PWM]},e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("1c",function(c){var e="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*",r="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт",t="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон",i={cN:"dquote",b:'""'},n={cN:"string",b:'"',e:'"|$',c:[i]},a={cN:"string",b:"\\|",e:'"|$',c:[i]};return{cI:!0,l:e,k:{keyword:r,built_in:t},c:[c.CLCM,c.NM,n,a,{cN:"function",b:"(процедура|функция)",e:"$",l:e,k:"процедура функция",c:[c.inherit(c.TM,{b:e}),{cN:"tail",eW:!0,c:[{cN:"params",b:"\\(",e:"\\)",l:e,k:"знач",c:[n,a]},{cN:"export",b:"экспорт",eW:!0,l:e,k:"экспорт",c:[c.CLCM]}]},c.CLCM]},{cN:"preprocessor",b:"#",e:"$"},{cN:"date",b:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}});hljs.registerLanguage("haskell",function(e){var i={cN:"comment",v:[{b:"--",e:"$"},{b:"{-",e:"-}",c:["self"]}]},c={cN:"pragma",b:"{-#",e:"#-}"},a={cN:"preprocessor",b:"^#",e:"$"},n={cN:"type",b:"\\b[A-Z][\\w']*",r:0},l={cN:"container",b:"\\(",e:"\\)",i:'"',c:[c,i,a,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e.inherit(e.TM,{b:"[_a-z][\\w']*"})]},t={cN:"container",b:"{",e:"}",c:l.c};return{aliases:["hs"],k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{cN:"module",b:"\\bmodule\\b",e:"where",k:"module where",c:[l,i],i:"\\W\\.|;"},{cN:"import",b:"\\bimport\\b",e:"$",k:"import|0 qualified as hiding",c:[l,i],i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[n,l,i]},{cN:"typedef",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",c:[c,i,n,l,t]},{cN:"default",bK:"default",e:"$",c:[n,l,i]},{cN:"infix",bK:"infix infixl infixr",e:"$",c:[e.CNM,i]},{cN:"foreign",b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[n,e.QSM,i]},{cN:"shebang",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},c,i,a,e.QSM,e.CNM,n,e.inherit(e.TM,{b:"^[_a-z][\\w']*"}),{b:"->|<-"}]}}); -------------------------------------------------------------------------------- /static/js/home.js: -------------------------------------------------------------------------------- 1 | // Main entry point 2 | $(function(){ 3 | //setupVids(); 4 | //setupFeatures(); 5 | 6 | $('.features .col-md-6').click(function(){ 7 | $(this).find('.collapse').collapse('toggle'); 8 | }); 9 | }); 10 | 11 | // Setup hovering of video thumbnails 12 | function setupVids(){ 13 | var $community = $('.community'); 14 | var $videos = $('.videos'); 15 | var $tagline = $('#tagline'); 16 | var $videoDesc = $('#video-description'); 17 | var $videoAnchor = $('#video-anchor'); 18 | var $videoView = $('#video-view'); 19 | var originalBackground = $community.css('background'); 20 | 21 | $videoDesc.hide(); 22 | // To keep a consistent height between transitions 23 | $videoDesc.css('height',$tagline.height()); 24 | 25 | $('.vid-thumbnail').each(function(){ 26 | var $this = $(this); 27 | var title = $this.attr('title'); 28 | var href = $this.attr('href'); 29 | $this.click(select); 30 | function select(){ 31 | $videos.find('.current').removeClass('current'); 32 | $this.addClass('current'); 33 | $videoAnchor.text(title); 34 | $videoAnchor.attr('href',href); 35 | $videoView.attr('href',href); 36 | $tagline.hide(); 37 | $videoDesc.show(); 38 | $community.css('background','#111111'); 39 | return false; 40 | } 41 | }); 42 | } 43 | 44 | // Expandable features 45 | function setupFeatures(){ 46 | $('.features .span6').each(function(){ 47 | var $this = $(this); 48 | $this.click(function(){ 49 | $this.find('.expandable').slideToggle(function(){ 50 | $this.find('.expand').slideToggle('fast'); 51 | }); 52 | }); 53 | if ($this.find('.expandable').size() == 0) 54 | $this.find('.expand').hide(); 55 | }); 56 | } 57 | -------------------------------------------------------------------------------- /static/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.0 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /static/js/report.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $('h1,h2,h3,h4,h5,h6').each(function(){ 3 | var h = $(this); 4 | h.find('a').each(function(){ 5 | var a = $(this); 6 | var href = a.attr('id'); 7 | if (href && !a.text()) { 8 | h.prepend($("").attr('href','#' + href).addClass('section-sign').text('§')); 9 | return false; 10 | } 11 | }); 12 | }); 13 | 14 | $('p').each(function(){ 15 | var h = $(this); 16 | h.find('a').each(function(){ 17 | var a = $(this); 18 | var href = a.attr('id'); 19 | if (href && !a.text()) { 20 | h.append($("").attr('href','#' + href).addClass('para-sign').text('¶')); 21 | return false; 22 | } 23 | }); 24 | }); 25 | 26 | hljs.configure({useBR: true}); 27 | $('.verbatim').each(function(i, block) { 28 | hljs.highlightBlock(block); 29 | block.innerHTML = 30 | block.innerHTML.replace(/ (::|=|\->) /g, 31 | ' $1 '); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /static/js/tryhaskell.js: -------------------------------------------------------------------------------- 1 | // Main tryhaskell module. 2 | tryhaskell = {}; 3 | 4 | // A success hook which can be bound and rebound or set as null. 5 | tryhaskell.successHook = null; 6 | 7 | // The current page number. 8 | tryhaskell.currentPage = null; 9 | 10 | // Stdout state from the current IO evaluation. 11 | tryhaskell.stdout = []; 12 | 13 | // Stdin state for the current IO evaluation. 14 | tryhaskell.stdin = []; 15 | 16 | // IO expression. 17 | tryhaskell.io = null; 18 | 19 | // Files in the file system. 20 | tryhaskell.files = { 21 | "/hello": "Hello, World!", 22 | "/files": "Your file system changes will stick around in your browser's local storage!", 23 | "/welcome": "Welcome to your mini filesystem! Try playing with this function: getDirectoryContents", 24 | "/functions": "You can also check out removeFile, writeFile, appendFile" 25 | }; 26 | 27 | try { 28 | if(typeof(Storage)!=="undefined") 29 | { 30 | tryhaskell.files = (localStorage.files && JSON.parse(localStorage.files)) 31 | || tryhaskell.files; 32 | }; 33 | } catch (e){ tryhaskell.files = {} } 34 | 35 | tryhaskell.showWarnings = function() { 36 | !navigator.cookieEnabled && $("#cookie-warning").show(); 37 | } 38 | 39 | // A pre-command hook which can prevent the command from being run if 40 | // it returns true. 41 | tryhaskell.preCommandHook = function(line,report){ 42 | var m, pages = tryhaskell.pages.list; 43 | if (m = line.trim().match(/^step([0-9]+)/)) { 44 | var n = m[1] * 1; 45 | if (n <= pages.length) { 46 | tryhaskell.setPage(n,null); 47 | report(); 48 | return true; 49 | } 50 | } 51 | else if (m = line.trim().match(/^lesson([0-9]+)/)) { 52 | var n = m[1] * 1; 53 | for (var i = 0; i < pages.length; i++) { 54 | if (pages[i].lesson == n) { 55 | tryhaskell.setPage(i,null); 56 | report(); 57 | return true; 58 | } 59 | } 60 | } else if (line.trim() == 'next') { 61 | if (tryhaskell.currentPage < tryhaskell.pages.list.length) { 62 | tryhaskell.setPage(tryhaskell.currentPage + 1); 63 | } 64 | report(); 65 | return true; 66 | } else if (line.trim() == 'back') { 67 | if (tryhaskell.currentPage > 1) { 68 | tryhaskell.setPage(tryhaskell.currentPage - 1); 69 | } 70 | report(); 71 | return true; 72 | } else if (line.trim() == 'help') { 73 | tryhaskell.setPage(2,null); 74 | report(); 75 | return true; 76 | } 77 | return false; 78 | }; 79 | 80 | // Make the console controller. 81 | tryhaskell.makeController = function(){ 82 | tryhaskell.controller = $('#console').console({ 83 | promptLabel: 'λ ', 84 | commandValidate: function(line){ 85 | if (line == "") return false; 86 | else return true; 87 | }, 88 | commandHandle: function(line,report){ 89 | if(tryhaskell.io === null){ 90 | if(!tryhaskell.preCommandHook(line,report)){ 91 | tryhaskell.ajaxCommand(line,report,[]); 92 | } 93 | } else { 94 | tryhaskell.stdin.push(line); 95 | tryhaskell.ajaxCommand(tryhaskell.io,report,tryhaskell.stdin); 96 | } 97 | }, 98 | animateScroll: true, 99 | promptHistory: true, 100 | welcomeMessage: 'Type Haskell expressions in here.', 101 | continuedPromptLabel: '> ' 102 | }); 103 | }; 104 | 105 | // Make an AJAX command to the server with the given line. 106 | tryhaskell.ajaxCommand = function(line,report,stdin){ 107 | var args = { 'exp': line, 108 | 'args': JSON.stringify([stdin,tryhaskell.files]) 109 | }; 110 | $.ajax({ 111 | url: 'https://tryhaskell.org/eval', 112 | dataType: 'jsonp', 113 | type: 'GET', 114 | data: args, 115 | success: function(result){ 116 | if(result.stdout !== undefined){ 117 | tryhaskell.files = result.files; 118 | result = result.stdout; 119 | tryhaskell.io = line; 120 | var msgs = []; 121 | if(result != null){ 122 | for(var i = tryhaskell.stdout.length; i < result.length; i++) { 123 | msgs.push({ msg: result[i], className: 'jquery-console-stdout' }); 124 | } 125 | } 126 | tryhaskell.stdout = result; 127 | tryhaskell.controller.continuedPrompt = true; 128 | report(msgs); 129 | tryhaskell.controller.continuedPrompt = false; 130 | } else { 131 | if(result.error !== undefined){ 132 | result = result.error; 133 | report([{ msg: result || 'Unspecified error. Have you installed mueval?', 134 | className:'jquery-console-error' }]); 135 | } else if(result.success){ 136 | result = result.success; 137 | var msgs = []; 138 | for(var i = tryhaskell.stdout.length; i < result.stdout.length; i++) { 139 | msgs.push({ msg: result.stdout[i], className: 'jquery-console-stdout' }); 140 | } 141 | if(tryhaskell.successHook != null) 142 | tryhaskell.successHook(result); 143 | if(result.type !== 'IO ()' && !result.value.match(/^').css('background-color',color)); 251 | } 252 | }); 253 | } 254 | // setInterval(update,5000); 255 | update(); 256 | }; 257 | 258 | // Handy method. 259 | String.prototype.trim = function() { 260 | return this.replace(/^[\t ]*(.*)[\t ]*$/,'$1'); 261 | }; 262 | 263 | // Main entry point. 264 | $(function(){ 265 | tryhaskell.showWarnings(); 266 | tryhaskell.makeController(); 267 | tryhaskell.makeGuide(); 268 | tryhaskell.activeUsers(); 269 | }); 270 | -------------------------------------------------------------------------------- /static/js/warp.reload.js: -------------------------------------------------------------------------------- 1 | $.get('/reload',function(){ 2 | window.location.reload(); 3 | }); 4 | -------------------------------------------------------------------------------- /static/markdown/downloads-main.md: -------------------------------------------------------------------------------- 1 | There are three widely used ways to install the Haskell toolchain on supported 2 | platforms. These are: 3 | 4 | - [Minimal installers](#minimal): Just GHC (the compiler), and build 5 | tools (primarily Cabal and Stack) are installed globally on your system, using your 6 | system's package manager. 7 | 8 | - [Stack](#stack): Installs the `stack` command globally: a project-centric 9 | build tool to automatically download and manage Haskell dependencies on a 10 | project-by-project basis. 11 | 12 | - [Haskell Platform](#platform): Installs GHC, Cabal, and some other tools, 13 | along with a starter set of libraries in a global location on your system. 14 | 15 | These options make different choices as to what is installed globally on your 16 | system and what is maintained in project-specific environments. Global 17 | installations allow more sharing across users and projects, but at the cost of 18 | potential conflicts between projects. To avoid these conflicts, each option 19 | has a lightweight *sandboxing* feature that creates largely self-contained, 20 | per-project environments. With Minimal you can optionally sandbox the 21 | libraries, avoiding most conflicts. Stack sandboxes the compiler, tools and 22 | libraries, so avoids nearly all kinds of conflicts between projects. With 23 | Platform you can also optionally sandbox libraries, but not the globally 24 | installed platform libraries. 25 | 26 | ### Haskell IDEs & other distributions 27 | 28 | In addition to the generic, cross-platform Haskell toolchain described above, 29 | there are also easy-to-use, platform-specific distributions and IDEs. 30 | The Haskell Wiki contains a [list of the most popular ones](https://wiki.haskell.org/Distributions). 31 | 32 | 34 | 35 |
36 | 37 | ## Minimal installers 38 | 39 | ### What they are
40 | 41 | Minimal installers provide centrally the 42 | [GHC](https://www.haskell.org/ghc) compiler and the 43 | [Cabal](https://www.haskell.org/cabal/) and 44 | [Stack](https://github.com/commercialhaskell/stack) tools for 45 | installing packages. Some may install further build tools (i.e. for 46 | parsing and lexing) as well. 47 | 48 | ### What you get 49 | 50 | - Only the core libraries necessary for each platform are included. 51 | - Cabal or Stack must be used to download and install packages after installation. 52 | 53 | ### How to get them 54 | 55 | - [Linux](/downloads/linux) 56 | - [OS X](https://www.haskell.org/platform/mac.html) (via the minimal platform) 57 | - [Windows](https://www.haskell.org/platform/windows.html) (via 58 | the minimal platform) 59 | 60 | ### Where to get help 61 | 62 | - For help learning Haskell itself, start with the [Documentation](https://www.haskell.org/documentation) page on the [Haskell Wiki](https://wiki.haskell.org/). 63 | - If you need help with [GHC](https://www.haskell.org/ghc)---the Haskell 64 | compiler---there is a comprehensive 65 | [GHC User Manual](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/index.html). 66 | - For help using Cabal to download or create additional packages (see 67 | [below](#libraries)), there is the 68 | [Cabal User Guide](https://www.haskell.org/cabal/users-guide/). 69 | - For help using Stack to download or create packages, see the stack documentation [below](#stackhelp). 70 | - Finally, you can ask questions of other Haskell users and experts on the 71 | [\#haskell IRC channel](irc://irc.freenode.net/haskell) on the Freenode IRC 72 | network. 73 | 74 | ## Stack 75 | 76 | ### What it is 77 | 78 | Stack is a cross-platform build tool for Haskell that 79 | handles management of the toolchain (including the GHC compiler and MSYS2 on 80 | Windows), building and registering libraries, and more. 81 | 82 | ### What you get 83 | 84 | - Once downloaded, it has the capacity to download and install GHC and other 85 | core tools. 86 | - Project development is isolated within sandboxes, including automatic 87 | download of the right version of GHC for a given project. 88 | - It manages all Haskell-related dependencies, ensuring reproducible builds. 89 | - It fetches from a curated repository of over a thousand packages by default, 90 | known to be mutually compatible. 91 | - It can optionally use Docker to produce standalone deployments. 92 | 93 | ### How to get it 94 | 95 | The [install and upgrade page](http://docs.haskellstack.org/en/stable/install_and_upgrade/) 96 | describes how to download Stack on various platforms, although the main 97 | three are repeated here: 98 | 99 | - [Ubuntu Linux](http://docs.haskellstack.org/en/stable/install_and_upgrade/#ubuntu) 100 | - [OS X](http://docs.haskellstack.org/en/stable/install_and_upgrade/#os-x) 101 | - [Windows](http://docs.haskellstack.org/en/stable/install_and_upgrade/#windows) 102 | 103 | Instructions for other Linux distributions, including Debian, Fedora, Red Hat, 104 | Nix OS, and Arch Linux, are also available. 105 | 106 | ### Where to get help 107 | 108 | For help with Haskell and GHC in general, see the links mentioned 109 | [above](#help). For Stack itself there are also the following resources: 110 | 111 | - The [README](https://github.com/commercialhaskell/stack/#readme) offers a 112 | general overview, and help with installation. 113 | - There is an 114 | [in-depth guide](http://docs.haskellstack.org) 115 | to using Stack. 116 | - [Getting started with Stack](http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html) 117 | introduces how to build new projects using Stack. 118 | - You may post issues and feature requests on its 119 | [GitHub issue tracker](https://github.com/commercialhaskell/stack). 120 | - There is a [mailing list for Stack](https://groups.google.com/d/forum/haskell-stack) 121 | - There is a dedicated 122 | [\#haskell-stack IRC channel](irc://irc.freenode.net/haskell-stack) on the 123 | Freenode IRC network. 124 | - The [StackOverflow haskell-stack tag](http://stackoverflow.com/questions/tagged/haskell-stack) 125 | has many stack-specific questions and answers. 126 | 127 | ## Haskell Platform 128 | 129 | ### What it is 130 | 131 | The Haskell Platform is a self-contained, all-in-one 132 | installer. After download, you will have everything necessary to build Haskell 133 | programs against a core set of useful libraries. It comes in both minimal versions 134 | with tools but no libraries outside of GHC core, or full versions, which include a 135 | broader set of globally installed libraries. 136 | 137 | ### What you get 138 | 139 | - The [Glasgow Haskell Compiler](https://www.haskell.org/ghc) 140 | - The [Cabal build system](https://www.haskell.org/cabal/), which can install 141 | new packages, and by default fetches from 142 | [Hackage](https://hackage.haskell.org/), the central Haskell package 143 | repository. 144 | - the [Stack](http://docs.haskellstack.org) tool for developing projects 145 | - Support for profiling and code coverage analysis 146 | - 35 core & widely-used [packages](https://www.haskell.org/platform/contents.html) 147 | 148 | ### How to get it 149 | 150 | The Platform is provided as a single installer, and can be downloaded at the 151 | links below. 152 | 153 | - [Linux](http://www.haskell.org/platform/linux.html) 154 | - [OS X](http://www.haskell.org/platform/mac.html) 155 | - [Windows](http://www.haskell.org/platform/windows.html) 156 | 157 | ### Where to get help 158 | 159 | - You can find a comprehensive list of 160 | [what the Platform offers](https://www.haskell.org/platform/contents.html). 161 | - See the general help mentioned [above](#help), which covers the usage of GHC, 162 | as well as the Cabal and Stack tools. 163 | 164 |
165 | 166 | ## Additional Libraries 167 | 168 | In Haskell, packages are configured and built with the Cabal package system built into GHC (and other compilers). For more specific details, see [The Cabal User Guide](https://www.haskell.org/cabal/users-guide/). The command line tools to download and install packages are either `cabal` or `stack`, each having different workflows. For details on their usage, see the documentation above. 169 | 170 | ### Hackage 171 | 172 | Hackage is a repository of packages to which anyone can freely upload at any time. The packages are available immediately and documentation will be generated and hosted there. It can be used by cabal install. 173 | 174 | You can install a package using cabal by running: 175 | 176 | $ cabal update 177 | $ cabal install the-package 178 | 179 | Note that if you are not in a sandbox, this will install the package globally, which is often not what you want, so it is recommended to set up sandboxes in your project directory by running `cabal sandbox init`. 180 | 181 | [Go to Hackage →](https://hackage.haskell.org/packages/) 182 | 183 | ### LTS Haskell 184 | 185 | LTS Haskell is a stackage-based long-term support set of packages which build and pass tests together, with backported bug fixes. 186 | 187 | [Get LTS Haskell →](http://www.stackage.org/lts) 188 | 189 | ### Stackage Nightly 190 | 191 | Stackage is a nightly generated stable repository of snapshots of package sets in which only packages which build and pass tests together are bundled together into a snapshot. 192 | 193 | [Get Stackage Nightly →](http://www.stackage.org/nightly) 194 | 195 | ### From source control repositories 196 | 197 | Installing from a source repository is also possible. For example, to clone and install the network package from source, you would run: 198 | 199 | $ git clone https://github.com/haskell/network 200 | $ cabal install network/ 201 | 202 | Or: 203 | 204 | $ git clone https://github.com/haskell/network 205 | $ cd network 206 | $ cabal install 207 | -------------------------------------------------------------------------------- /static/markdown/home.md: -------------------------------------------------------------------------------- 1 | Haskell is an advanced purely-functional programming language. An 2 | open-source product of more than twenty years of cutting-edge 3 | research, it allows rapid development of robust, concise, correct 4 | software. With strong support for integration with other languages, 5 | built-in concurrency and parallelism, debuggers, profilers, rich 6 | libraries and an active community, Haskell makes it easier to produce 7 | flexible, maintainable, high-quality software. 8 | -------------------------------------------------------------------------------- /static/markdown/irc.md: -------------------------------------------------------------------------------- 1 | # IRC Channels 2 | 3 | The IRC channel can be an excellent place to learn more about Haskell, 4 | and to just keep in the loop on new things in the Haskell world. Many 5 | new developments in the Haskell world first appear on the irc channel. 6 | 7 | Point your irc client to `chat.freenode.net` and then join the 8 | `#haskell` channel. 9 | 10 | Alternately, you can try 11 | [http://java.freenode.net/](http://java.freenode.net/) or 12 | [http://webchat.freenode.net/](http://webchat.freenode.net/) which 13 | connects inside the browser. 14 | 15 | ## Logs 16 | 17 | Searchable logs are available on IRC Browse for: 18 | 19 | * [#haskell](http://ircbrowse.net/haskell) — 20 | [recent messages](http://ircbrowse.net/day/haskell/today/recent) 21 | * [#haskell-game](http://ircbrowse.net/haskell-game) — 22 | [recent messages](http://ircbrowse.net/day/haskell-game/today/recent) 23 | * [#haskell-beginners](http://ircbrowse.net/haskell-beginners) — 24 | [recent messages](http://ircbrowse.net/day/haskell-beginners/today/recent) 25 | * [#diagrams](http://ircbrowse.net/diagrams) — 26 | [recent messages](http://ircbrowse.net/day/diagrams/today/recent) 27 | * [#tasty](http://ircbrowse.net/tasty) — 28 | [recent messages](http://ircbrowse.net/day/tasty/today/recent) 29 | * [#haskell-distributed](http://ircbrowse.net/haskell-distributed) — 30 | [recent messages](http://ircbrowse.net/day/haskell-distributed/today/recent) 31 | 32 | Plain text logs are also available at 33 | [tunes](http://tunes.org/~nef/logs/haskell/). 34 | 35 | ## Related channels 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
ChannelPurpose
#haskell.au Australian Haskell hackers
#haskell-br Brazilian Portuguese (pt_BR) speakers
#haskell.cz Czech speakers (UTF-8)
#haskell.de German speakers
#haskell.dut Dutch speakers
#haskell.es Spanish speakers
#haskell.fi Finnish speakers
#haskell-fr French speakers
#haskell.hr Croatian speakers
#haskell.it Italian speakers
#haskell.jp Japanese speakers
#haskell.no Norwegian speakers
#haskell.pt Portuguese speakers
#haskell-pl Polish speakers
#haskell.ru Russian speakers. Seems that most of them migrated to Jabber conference (haskell@conference.jabber.ru).
#haskell_ru Russian speakers again, in UTF-8. For those, who prefer good ol' IRC channel with a lambdabot.
#haskell.se Swedish speakers
#haskell.tw Chinese speakers (mainly in Taiwan)
#haskell.vn Vietnamese speakers
#haskell-blah Haskell people talking about anything except Haskell itself
#haskell-game The hub for Haskell-based game development
#haskell-in-depth slower paced discussion of use, theory, implementation etc with no monad tutorials!
#haskell-iphone Haskell-based iPhone development
#haskell-apple Projects that target iOS or OS X using Haskell.
#haskell-lisp Haskell Lisp - projects that are creating Lisps written in Haskell, or Haskell implementations written in Lisps.
#haskell-llvm For projects using Haskell and LLVM
#haskell-overflow Overflow conversations
#haskell-web Friendly, practical discussion of haskell web app/framework/server development
68 | 69 | ## Platform-specific 70 | 71 | 72 | 73 | 74 | 75 |
ChannelPurpose
#arch-haskell Arch Linux/ specific Haskell conversations
#fedora-haskellFedora Haskell SIG
#gentoo-haskellGentoo/Linux specific Haskell conversations
76 | 77 | ## Projects using haskell 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
ChannelPurpose
#darcs Darcs revision control system
#diagrams Diagrams EDSL
#disciplinedThe Disciplined Disciple Compiler (DDC)
#hackage Haskell's software distribution infrastructure
#haskell-lens Lens discussions
#happs Happstack web framework
#tasty Tasty test framework
#hledger hledger accounting tools and library
#leksahLeksah IDE for Haskell development
#perl6 Perl 6 development (plenty of Haskell chat there too)
#snapframework Snap web framework
#xmonadXmonad tiling window manager
#yesod Yesod web framework
#haskell-distributed Distributed Haskell discussion
#chicagohaskellChicago Haskell programmers group
96 | -------------------------------------------------------------------------------- /static/markdown/linux-install.md: -------------------------------------------------------------------------------- 1 | ## Package-based install 2 | 3 | ### Ubuntu 4 | 5 | Steps to setup ghc and cabal: 6 | 7 | sudo apt-get update 8 | sudo apt-get install -y software-properties-common 9 | sudo add-apt-repository -y ppa:hvr/ghc 10 | sudo apt-get update 11 | sudo apt-get install -y cabal-install-1.22 ghc-7.10.3 12 | cat >> ~/.bashrc <> $HOME/.bashrc 26 | 27 | Steps to setup stack are [on the stack website](https://docs.haskellstack.org/en/stable/install_and_upgrade/#debian). 28 | 29 | ### Fedora 30 | 31 | GHC and cabal-install are in the official Fedora repos, to install: 32 | 33 | sudo dnf install ghc cabal-install 34 | 35 | - Fedora 26 has ghc-8.0.2 and cabal-install-1.24.0.2 36 | - Fedora 25 has ghc-7.10.3 and cabal-install-1.22.9.0 37 | - Fedora 24 has ghc-7.8.4 and cabal-install-1.18.1.0 38 | 39 | There are also unofficial Fedora Copr ghc repos which include cabal-install: 40 | 41 | - [petersen/ghc-8.0.2 Copr repo (F24,F25)](https://copr.fedorainfracloud.org/coprs/petersen/ghc-8.0.2) 42 | - [petersen/ghc-7.10.3 Copr repo (F24)](https://copr.fedorainfracloud.org/coprs/petersen/ghc-7.10.3) 43 | 44 | (earlier 7.10.x and 8.0.1 coprs are also available). 45 | 46 | Note ghc from Copr cannot be installed in parallel with official Fedora ghc packages. 47 | 48 | Steps to setup stack are 49 | [on the stack website](https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md#fedora). 50 | You can also obtain stack from the fedora [petersen/stack Copr repo](https://copr.fedoraproject.org/coprs/petersen/stack/) 51 | 52 | ### EPEL for RHEL/CentOS/etc 53 | - EPEL 7 has ghc-7.6.3 and cabal-install-1.16.1.0 54 | - EPEL 5 and 6 have ghc-7.0.4 and cabal-install-0.10.2 55 | 56 | To install these older versions of ghc and cabal-install from the official EPEL repo, just run the install command: 57 | 58 | sudo yum install ghc cabal-install 59 | 60 | For newer versions of ghc you can use the unofficial Fedora Copr repos: 61 | 62 | - [petersen/ghc-8.0.2 Copr repo (EL7)](https://copr.fedorainfracloud.org/coprs/petersen/ghc-8.0.2) 63 | - [petersen/ghc-7.10.3 Copr repo (EL7,EL6)](https://copr.fedorainfracloud.org/coprs/petersen/ghc-7.10.3) 64 | - [petersen/ghc-7.8.4 Copr repo (EL7,EL6)](https://copr.fedorainfracloud.org/coprs/petersen/ghc-7.8.4) 65 | - [petersen/ghc-7.4.2 Copr repo (EL6,EL5)](https://copr.fedorainfracloud.org/coprs/petersen/ghc-7.4.2) 66 | 67 | Note the ghc packages from Copr cannot be installed in parallel with EPEL ghc. 68 | 69 | Steps to setup stack are 70 | [on the stack website](https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md#fedora). 71 | You can also obtain stack from the fedora [petersen/stack Copr repo](https://copr.fedoraproject.org/coprs/petersen/stack/) 72 | 73 | ### Arch Linux 74 | 75 | The official repos on Arch Linux contain packages `ghc`, `cabal-install`, `happy`, `alex`, `haddock`. Install them with: 76 | 77 | sudo pacman -S ghc cabal-install happy alex haddock 78 | 79 | Steps to setup stack are 80 | [on the stack website](https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md#arch-linux). 81 | 82 | ### Generic Tarballs 83 | 84 | Generic minimal installers that work on most modern linux 85 | distributions are available via the [Haskell Platform](https://www.haskell.org/platform/linux.html#linux-generic) 86 | -------------------------------------------------------------------------------- /static/markdown/mailing-lists.md: -------------------------------------------------------------------------------- 1 | # Mailing Lists 2 | 3 | ## Haskell-Cafe 4 | 5 | General Haskell questions; extended discussions. 6 | 7 | Forum in which it's acceptable to ask anything, no matter how naive, 8 | and get polite replies. 9 | 10 | [Subscribe now →](http://mail.haskell.org/mailman/listinfo/haskell-cafe) 11 | 12 | [Archives](http://mail.haskell.org/pipermail/haskell-cafe/) 13 | 14 | ## Haskell Announcements 15 | 16 | Announcements only. 17 | 18 | Intended to be a low-bandwidth list, to which it is safe to subscribe 19 | without risking being buried in email. If a thread becomes longer than 20 | a handful of messages, please transfer to Haskell-Cafe. 21 | 22 | [Subscribe now →](http://mail.haskell.org/mailman/listinfo/haskell) 23 | 24 | [Archives](http://mail.haskell.org/pipermail/haskell/) 25 | 26 | ## Beginners 27 | 28 | Beginner-level, i.e., elementary, Haskell questions and 29 | discussions. Any newbie question is welcome. 30 | 31 | [Subscribe now →](http://mail.haskell.org/mailman/listinfo/beginners) 32 | 33 | [Archives](http://mail.haskell.org/pipermail/beginners/) 34 | 35 | ## Haskell Community 36 | 37 | Discussions and feedback regarding planned and/or upcoming 38 | community-related decisions. Subscribe if you want to be in the know 39 | and participate in the decision-making process of the haskell.org committee. 40 | 41 | [Subscribe now →](http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-community) 42 | 43 | [Archives](https://mail.haskell.org/pipermail/haskell-community/) 44 | 45 | ## Other mailing lists 46 | 47 | There are many lists hosted on haskell.org, though be warned some are 48 | no longer active. The complete list is 49 | [here](http://mail.haskell.org). 50 | -------------------------------------------------------------------------------- /static/markdown/manual-install.md: -------------------------------------------------------------------------------- 1 | ### 1. Install GHC 2 | 3 | GHC has its own web site with license information, FAQ, download links 4 | and changelogs. Depending on your operating system, there should be a 5 | package made for its package manager, otherwise (e.g. Windows) it will 6 | be an installer. 7 | 8 | You can also download the .tar.gz/.zip and unpack and install the 9 | executables and so forth manually. 10 | 11 | Or you can even install from source, for which 12 | [there is documentation](https://ghc.haskell.org/trac/ghc/wiki/Building). 13 | 14 | [Download GHC now →](https://www.haskell.org/ghc/download.html) 15 | 16 | ### 2. Install Cabal-install 17 | 18 | After installing GHC, you will want the Haskell package manager: 19 | 20 | [Get the Cabal archive →](http://hackage.haskell.org/package/cabal-install) 21 | 22 | Download the tar.gz file, extract and inside the resulting directory, 23 | run: 24 | 25 | $ sh ./bootstrap.sh 26 | 27 | This will automatically download and install all the packages 28 | necessary to setup Cabal install. 29 | 30 | Once complete, you should add `$HOME/.cabal/bin` to your PATH. A 31 | simple way to do this is to edit your `~/.bashrc` and place in there: 32 | 33 | export PATH=$HOME/.cabal/bin:$PATH 34 | 35 | Now you should be able to run cabal: 36 | 37 | $ cabal --version 38 | cabal-install version 1.18.0.2 39 | using version 1.18.1.2 of the Cabal library 40 | 41 | You can now update your package set: 42 | 43 | $ cabal update 44 | 45 | And install packages into a sandbox so it doesn't conflict with other projects: 46 | 47 | $ mkdir my-project 48 | $ cd my-project 49 | $ cabal sandbox init 50 | $ cabal install the-package-name 51 | 52 | ### 3. Installing Stack 53 | 54 | Generic stack binary downloads are available from the [stack website](https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md#linux). 55 | -------------------------------------------------------------------------------- /static/markdown/osx-install.md: -------------------------------------------------------------------------------- 1 | This download is provided by 2 | [GHC for OS X](http://ghcformacosx.github.io/) for 64-bit Mac OS X 3 | 10.9 and later. 4 | 5 | For earlier versions of Mac OS X than 10.9, you should use the [Haskell Platform Installer](https://www.haskell.org/platform/mac.html). 6 | 7 | ## Steps to install 8 | 9 | * Download and unzip [ghc-7.8.4-r0.zip](https://github.com/ghcformacosx/ghc-dot-app/releases/download/v7.8.4-r0/ghc-7.8.4-r0.zip) (165MB) 10 | * Move the resultant app to a stable location such as `/Applications` 11 | * Double-click the application and follow the further instructions, 12 | which will guide you in how to add GHC to your Terminal's path, and 13 | to install Xcode. 14 | 15 | ## What is included 16 | 17 | * GHC 7.8.4 18 | * cabal-install 1.22.0.0 19 | * HTML documentation 20 | * man pages 21 | * A small GUI app wrapper to help you set up your environment for Haskell 22 | 23 | ## Report issues 24 | 25 | You can report bugs for GHC for OS X [on the Github issue tracker](https://github.com/ghcformacosx/ghc-dot-app/issues). 26 | -------------------------------------------------------------------------------- /static/markdown/windows-install.md: -------------------------------------------------------------------------------- 1 | ### MinGHC 2 | 3 | MinGHC is a minimal installer for GHC, [cabal](https://www.haskell.org/cabal/), and [stack](https://github.com/commercialhaskell/stack/blob/master/README.md). 4 | 5 | Download the latest Windows installer here: 6 | 7 | * [MinGHC installer for GHC 7.10.2 (32-bit)](https://github.com/fpco/minghc/releases/download/2015-08-13/minghc-7.10.2-i386.exe) 8 | 9 | * [MinGHC installer for GHC 7.10.2 (64-bit)](https://github.com/fpco/minghc/releases/download/2015-08-13/minghc-7.10.2-x86_64.exe) 10 | 11 | Other versions are available at the [MinGHC homepage](https://github.com/fpco/minghc). 12 | 13 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskell0x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/report/haskell2010/haskell0x.png -------------------------------------------------------------------------------- /static/report/haskell2010/haskell12.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |
18 |

1There are two minor exceptions to this statement. First, default declarations scope over a single module (Section 4.3.4). Second, Rule 2 27 | of the monomorphism restriction (Section 4.5.5) is affected by module boundaries.

33 | 34 | 35 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskell1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/report/haskell2010/haskell1x.png -------------------------------------------------------------------------------- /static/report/haskell2010/haskell2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/report/haskell2010/haskell2x.png -------------------------------------------------------------------------------- /static/report/haskell2010/haskell3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/report/haskell2010/haskell3x.png -------------------------------------------------------------------------------- /static/report/haskell2010/haskell4.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |
18 |

1Miranda is a trademark of Research Software Ltd.

21 | 22 | 23 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskell4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/report/haskell2010/haskell4x.png -------------------------------------------------------------------------------- /static/report/haskell2010/haskell9.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |
18 |

1Note that the syntax of a pattern guard is the same as that of a generator in a list comprehension. The contextual difference is that, in a list 21 | comprehension, a pattern of type t goes with an expression of type [t].

29 | 30 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskellch24.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 24 Foreign 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 23 |

Chapter 24
Foreign

26 |
27 | 28 | 29 | 30 |
31 | module Foreign ( 32 |  
    module Data.Bits,  module Data.Int,  module Data.Word,  module Foreign.Ptr, 33 |  
    module Foreign.ForeignPtr,  module Foreign.StablePtr, 34 |  
    module Foreign.Storable,  module Foreign.Marshal 35 |  
  ) where 36 |
37 |

38 |

The module Foreign combines the interfaces of all modules providing language-independent marshalling support, 40 | namely 41 |

42 |
54 | 63 | 68 | 73 | 78 | 83 |
module Data.Bits
module Data.Int
module Data.Word
module Foreign.Ptr
module Foreign.ForeignPtr
module Foreign.StablePtr
module Foreign.Storable
module Foreign.Marshal
84 |
85 | 91 |

93 | 94 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskellch25.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 25 Foreign.C 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |

23 |

Chapter 25
Foreign.C

26 |
27 | 28 | 29 | 30 |
31 | module Foreign.C ( 32 |  
    module Foreign.C.Types,  module Foreign.C.String,  module Foreign.C.Error 33 |  
  ) where 34 |
35 |

36 |

The module Foreign.C combines the interfaces of all modules providing C-specific marshalling support, 38 | namely 39 |

40 |
48 | 53 | 58 |
module Foreign.C.Types
module Foreign.C.String
module Foreign.C.Error
59 |
60 | 66 |

68 | 69 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskellch30.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 30 Foreign.Marshal 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |

23 |

Chapter 30
Foreign.Marshal

26 |
27 | 28 | 29 | 30 |
31 | module Foreign.Marshal ( 32 |  
    module Foreign.Marshal.Alloc,  module Foreign.Marshal.Array, 33 |  
    module Foreign.Marshal.Error,  module Foreign.Marshal.Utils, 34 |  
    unsafeLocalState 35 |  
  ) where 36 |
37 |

38 |

The module Foreign.Marshal re-exports the other modules in the Foreign.Marshal hierarchy: 41 |

42 |
50 | 55 | 60 | 65 |
module Foreign.Marshal.Alloc
module Foreign.Marshal.Array
module Foreign.Marshal.Error
module Foreign.Marshal.Utils
66 |
67 |

and provides one function: 68 |

69 |
unsafeLocalState :: IO a -> a
81 | Sometimes an external entity is a pure function, except that it passes arguments and/or results 82 | via pointers. The function unsafeLocalState permits the packaging of such entities as pure 84 | functions. 85 |

The only IO operations allowed in the IO action passed to unsafeLocalState are (a) 87 | local allocation (alloca, allocaBytes and derived operations such as withArray and 91 | withCString), and (b) pointer operations (Foreign.Storable and Foreign.Ptr) on the 95 | pointers to local storage, and (c) foreign functions whose only observable effect is to read and/or write 96 | the locally allocated memory. Passing an IO operation that does not obey these rules results in undefined 97 | behaviour. 98 |

It is expected that this operation will be replaced in a future revision of Haskell. 99 |

100 | 106 |

108 | 109 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskellch39.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 39 System.Environment 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |

23 |

Chapter 39
System.Environment

26 |
27 | 28 | 29 | 30 |
31 | module System.Environment ( 32 |  
    getArgs,  getProgName,  getEnv 33 |  
  ) where 34 |
35 |

36 |
37 |
47 |
getArgs :: IO [String]
48 | Computation getArgs returns a list of the program’s command line arguments (not including the 51 | program name). 52 |
53 |
54 |
64 |
getProgName :: IO String
65 | Computation getProgName returns the name of the program as it was invoked. 68 |

However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum 69 | portability, we just return the leafname of the program as invoked. Even then there are some differences 70 | between platforms: on Windows, for example, a program invoked as foo is probably really FOO.EXE, 72 | and that is what getProgName will return. 75 |

76 |
77 |
89 |
getEnv :: String -> IO String
90 | Computation getEnvvar returns the value of the environment variable var. 95 |

This computation may fail with: 96 |

    97 |
  • System.IO.Error.isDoesNotExistError if the environment variable does not exist. 99 |
100 |
101 | 107 |

109 | 110 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskellch40.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 40 System.Exit 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |

23 |

Chapter 40
System.Exit

26 |
27 | 28 | 29 | 30 |
31 | module System.Exit ( 32 |  
    ExitCode(ExitSuccess, ExitFailure),  exitWith,  exitFailure,  exitSuccess 33 |  
  ) where 34 |
35 |

36 |
37 |
data ExitCode
45 |
57 | 64 |
= ExitSuccess indicates successful termination;
| ExitFailure Int indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).
67 |
68 |

Defines the exit codes that a program can return. 69 |

70 |
71 |
80 | 91 | 97 | 100 |
instance Eq ExitCode
instance Ord ExitCode
instance Read ExitCode
instance Show ExitCode
101 |
102 |
103 |
exitWith :: ExitCode -> IO a
115 | Computation exitWith code terminates the program, returning code to the program’s 119 | caller. The caller may interpret the return code as it wishes, but the program should return 120 | ExitSuccess to mean normal completion, and ExitFailure n to mean that the program 125 | encountered a problem from which it could not recover. The value exitFailure is equal to 128 | exitWith (ExitFailure exitfail), where exitfail is implementation-dependent. 133 | exitWith bypasses the error handling in the I/O monad and cannot be intercepted by catch from 138 | the Prelude. 140 |
141 |
142 |
exitFailure :: IO a
152 | The computation exitFailure is equivalent to exitWith (ExitFailure exitfail), where 161 | exitfail is implementation-dependent. 163 |
164 |
165 |
exitSuccess :: IO a
175 | The computation exitSuccess is equivalent to exitWith ExitSuccess, It terminates the 182 | program successfully. 183 |
184 | 190 |

192 | 193 | -------------------------------------------------------------------------------- /static/report/haskell2010/haskellli2.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/static/report/haskell2010/haskellli2.html -------------------------------------------------------------------------------- /static/report/haskell2010/haskellli3.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | Bibliography 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 |

22 |

Bibliography

24 |
25 |

26 | [1]   J. Backus. Can programming be liberated from the von Neumann style? A functional style and its 28 | algebra of programs. CACM, 21(8):613–641, August 1978. 30 |

31 |

32 | [2]   Unicode Consortium. Unicode standard. 34 | http://unicode.org/standard/standard.html. 37 |

38 |

39 | [3]   H.K. Curry and R. Feys. Combinatory Logic. North-Holland Pub. Co., Amsterdam, 1958. 42 |

43 |

44 | [4]   Luis Damas and Robin Milner. Principal type-schemes for functional programs. In Conference 47 | Record of the 9th Annual ACM Symposium on Principles of Programming Languages, pages 207–12, 49 | New York, 1982. ACM Press. 50 |

51 |

52 | [5]   James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. The Java Series. 55 | Addison-Wesley, 1997. 56 |

57 |

58 | [6]   R. Hindley. The principal type scheme of an object in combinatory logic. Transactions of the 61 | American Mathematical Society, 146:29–60, December 1969. 63 |

64 |

65 | [7]   International Standard ISO/IEC. Programming languages – C. 9899:1999 (E). 67 |

68 | 69 | 70 | 71 |

72 | [8]   MP Jones. A system of constructor classes: overloading and implicit higher-order polymorphism. 74 | Journal of Functional Programming, 5(1):1–36, January 1995. 76 |

77 |

78 | [9]   Brian W. Kernighan and Dennis M. Ritchie. The C Programming Language. Prentice Hall, second 81 | edition, 1988. 82 |

83 |

84 | [10]   Sheng Liang. The Java Native Interface: Programmer’s Guide and Specification. Addison Wesley, 87 | 1999. 88 |

89 |

90 | [11]   Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1996. 93 |

94 |

95 | [12]   P. Penfield, Jr. Principal values and branch cuts in complex APL. In APL ’81 Conference 98 | Proceedings, pages 248–256, San Francisco, September 1981. 100 |

101 |

102 | [13]   P. Wadler and S. Blott. How to make ad hoc polymorphism less ad hoc. In Proceedings of 16th 107 | ACM Symposium on Principles of Programming Languages, pages 60–76, Austin, Texas, January 1989. 109 |

110 |
111 | 112 | 113 | 114 | 119 |

121 | 122 | -------------------------------------------------------------------------------- /static/source/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | bower_components/* 3 | -------------------------------------------------------------------------------- /static/source/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hl-assets", 3 | "description": "", 4 | "main": "gulpfile.js", 5 | "authors": [ 6 | "David Deutsch " 7 | ], 8 | "license": "BSD3", 9 | "homepage": "https://github.com/daviddeutsch/hl-assets", 10 | "moduleType": [], 11 | "private": true, 12 | "ignore": [ 13 | "**/.*", 14 | "node_modules", 15 | "bower_components", 16 | "test", 17 | "tests" 18 | ], 19 | "dependencies": { 20 | "bootstrap-sass": "~3.3.6" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /static/source/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'), 2 | postcss = require('gulp-postcss'), 3 | sass = require('gulp-sass'), 4 | rename = require('gulp-rename'), 5 | sourcemaps = require('gulp-sourcemaps'), 6 | concat = require('gulp-concat'), 7 | autoprefixer = require('autoprefixer'), 8 | cssnano = require('gulp-cssnano'); 9 | 10 | gulp.task('css', function() { 11 | return gulp.src('scss/hl.scss') 12 | //.pipe(sourcemaps.init()) 13 | .pipe(sass({ precision: 10 })) 14 | .pipe(postcss([ autoprefixer({ browsers: [ 15 | "Android 2.3", 16 | "Android >= 4", 17 | "Chrome >= 20", 18 | "Firefox >= 24", 19 | "Explorer >= 8", 20 | "iOS >= 6", 21 | "Opera >= 12", 22 | "Safari >= 6" 23 | ] }) ])) 24 | //.pipe(sourcemaps.write('.')) 25 | .pipe(gulp.dest('../css/')) 26 | .pipe(cssnano()) 27 | .pipe(rename({ extname: '.min.css' })) 28 | .pipe(gulp.dest('../css/')); 29 | }); 30 | 31 | 32 | gulp.task('watch', function() { 33 | var watcher = gulp.watch('scss/*', ['css']); 34 | 35 | watcher.on('change', function (event) { 36 | console.log('File ' + event.path + ' was ' + event.type + '. Now running css task...'); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /static/source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hl-assets", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "gulpfile.js", 6 | "dependencies": {}, 7 | "devDependencies": { 8 | "autoprefixer": "^6.3.3", 9 | "gulp-autoprefixer": "^3.1.0", 10 | "gulp-concat": "^2.6.0", 11 | "gulp-cssnano": "^2.1.1", 12 | "gulp-postcss": "^6.1.0", 13 | "gulp-rename": "^1.2.2", 14 | "gulp-sass": "^2.2.0", 15 | "gulp-sourcemaps": "^1.6.0", 16 | "gulp-uglify": "^1.5.2" 17 | }, 18 | "scripts": { 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/daviddeutsch/hl-assets" 24 | }, 25 | "author": "David Deutsch", 26 | "license": "BSD3", 27 | "bugs": { 28 | "url": "https://github.com/daviddeutsch/hl-assets/issues" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /static/source/scss/_bootstrap.scss: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/variables"; 3 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins"; 4 | 5 | // Reset and dependencies 6 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/normalize"; 7 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/print"; 8 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/glyphicons"; 9 | 10 | // Core CSS 11 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/scaffolding"; 12 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/type"; 13 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/code"; 14 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/grid"; 15 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/tables"; 16 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/forms"; 17 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/buttons"; 18 | 19 | // Components 20 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/component-animations"; 21 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/dropdowns"; 22 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/button-groups"; 23 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/input-groups"; 24 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/navs"; 25 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/navbar"; 26 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/breadcrumbs"; 27 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/pagination"; 28 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/pager"; 29 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/labels"; 30 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/badges"; 31 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/jumbotron"; 32 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/thumbnails"; 33 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/alerts"; 34 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/progress-bars"; 35 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/media"; 36 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/list-group"; 37 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/panels"; 38 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/responsive-embed"; 39 | //@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/wells"; 40 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/close"; 41 | 42 | // Components w/ JavaScript 43 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/modals"; 44 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/tooltip"; 45 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/popovers"; 46 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/carousel"; 47 | 48 | // Utility classes 49 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/utilities"; 50 | @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/responsive-utilities"; 51 | -------------------------------------------------------------------------------- /static/source/scss/_code.scss: -------------------------------------------------------------------------------- 1 | pre { 2 | .hs-definition { 3 | color: #70bee2; 4 | } 5 | 6 | .hs-num { 7 | color: #ac7ff5; 8 | } 9 | 10 | .hs-keyword { 11 | color: #6144b3; 12 | } 13 | 14 | .hs-layout, 15 | .hs-keyglyph { 16 | color: #606060; 17 | } 18 | } 19 | 20 | .rejected-code { 21 | position: relative; 22 | 23 | pre, 24 | .pre * { 25 | color: #a94442; 26 | background-color: #f2ebeb; 27 | border-color: #ebccd1; 28 | } 29 | 30 | .rejected-note { 31 | position: absolute; 32 | top: 0; 33 | line-height: 2em; 34 | height: 2em; 35 | vertical-align: middle; 36 | right: 0.5em; 37 | color: #a94442; 38 | font-style: italic; 39 | } 40 | } 41 | 42 | .branding.sample { 43 | pre { 44 | line-height: 1.3; 45 | } 46 | 47 | h4 { 48 | margin-top: 1.1em; 49 | } 50 | } 51 | 52 | #console { 53 | font-family: monospace; 54 | } 55 | 56 | .jquery-console-nofocus { 57 | opacity: 0.8; 58 | } 59 | 60 | .jquery-console-focus .jquery-console-cursor { 61 | background: #f7f7f7; 62 | color:#eee; 63 | font-weight:bold; 64 | } 65 | 66 | .jquery-console-inner { 67 | max-height: 20em; 68 | overflow: auto; 69 | word-wrap: break-word; 70 | } 71 | 72 | .jquery-console-prompt-label { 73 | color: #db83ed; 74 | font-weight: bold; 75 | } 76 | 77 | .jquery-console-prompt-box { 78 | clear: both; 79 | } 80 | 81 | .jquery-console-error { 82 | color: #b261ad; 83 | clear: left; 84 | } 85 | 86 | .jquery-console-value { 87 | color: #469ef1; 88 | clear: left; 89 | float: left; 90 | } 91 | 92 | .jquery-console-stdout { 93 | color: #31a462; 94 | clear: left; 95 | float: left; 96 | } 97 | 98 | .jquery-console-type { 99 | color: #f7f7f7; 100 | } 101 | 102 | .jquery-console-welcome { 103 | color: #fff; 104 | margin-bottom: 0.5em; 105 | } 106 | 107 | .jquery-console-stdout + .jquery-console-type { 108 | display: none !important; 109 | } 110 | 111 | .jquery-console-value:empty + .jquery-console-type { 112 | visibility: visible; 113 | } 114 | 115 | .jquery-console-value + .jquery-console-type { 116 | float: left; 117 | margin-left: .5em; 118 | } 119 | 120 | #guide .spoiler { 121 | color: #f7f7f9; 122 | background: #f7f7f9; 123 | 124 | &:hover { 125 | color: #d14; 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /static/source/scss/_home.scss: -------------------------------------------------------------------------------- 1 | .community { 2 | min-height: 280px; 3 | 4 | background-size: cover; 5 | 6 | margin: $grid-gutter-width 0; 7 | 8 | h2, 9 | a { 10 | color: #fff; 11 | } 12 | 13 | a:hover { 14 | color: #fff; 15 | } 16 | } 17 | 18 | .pattern-bg { 19 | background: url("/static/img/pattern.png"); 20 | background-size: cover; 21 | color: #fff; 22 | 23 | padding: $grid-gutter-width/2 0 $grid-gutter-width; 24 | 25 | box-shadow: 0 0 4em rgba(0,0,0,0.25) inset; 26 | 27 | a { 28 | color: #db83ed; 29 | 30 | &:hover { 31 | color: #b663b1; 32 | } 33 | } 34 | 35 | code { 36 | color: #fff; 37 | background-color: rgba(235, 228, 243, 0.25); 38 | } 39 | } 40 | 41 | .sponsors p { 42 | font-size: 95%; 43 | line-height: 130%; 44 | } 45 | 46 | .features { 47 | .col-md-6 { 48 | cursor: pointer; 49 | } 50 | 51 | .collapse { 52 | border-bottom: 1px solid rgba(0,0,0,0.2); 53 | padding: 0 0 1.5em; 54 | cursor: default; 55 | } 56 | } 57 | 58 | .videos { 59 | a:hover { 60 | text-decoration: none; 61 | } 62 | 63 | .thumbnail:hover { 64 | a { 65 | text-decoration: none; 66 | 67 | &:hover { 68 | text-decoration: none; 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /static/source/scss/_layout.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb { 2 | display: none; 3 | } 4 | 5 | .footer { 6 | background: #323232; 7 | color: #fff; 8 | padding: $grid-gutter-width 0 $grid-gutter-width/2; 9 | 10 | a { 11 | color: #fff; 12 | } 13 | } 14 | 15 | .navbar-default .navbar-brand { 16 | color: $brand-primary; 17 | } 18 | 19 | .row-flex { 20 | display: flex; 21 | flex-wrap: wrap; 22 | 23 | > div[class*='col-'] { 24 | display: flex; 25 | flex: 0 1 auto; 26 | 27 | .thumbnail { 28 | width: 100%; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /static/source/scss/_typography.scss: -------------------------------------------------------------------------------- 1 | pre, 2 | code { 3 | font-family: 'Ubuntu Mono', monospace; 4 | } 5 | 6 | h1, h2 { 7 | font-family: $font-family-serif; 8 | } 9 | 10 | h1 { 11 | &.name { 12 | font-size: $font-size-h1 * 2.2; 13 | 14 | @media (max-width: $screen-xs-max) { 15 | font-size: $font-size-h1; 16 | } 17 | 18 | font-weight: 900; 19 | 20 | img { 21 | vertical-align: bottom; 22 | 23 | @media (max-width: $screen-xs-max) { 24 | width: 68px; 25 | } 26 | } 27 | } 28 | } 29 | 30 | .branding { 31 | @media (max-width: $screen-xs-max) { 32 | h4 { 33 | text-align: center; 34 | } 35 | } 36 | } 37 | 38 | hr { 39 | border-top: 4px solid #5d4f85; 40 | } 41 | 42 | .navbar-brand .logo img { 43 | height: 1em; 44 | 45 | transition: all 200ms ease-in-out; 46 | opacity: 0.9; 47 | filter: contrast(50%); 48 | 49 | &:hover { 50 | opacity: 1; 51 | filter: contrast(100%); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /static/source/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | $brand-primary: #9E358F; 2 | 3 | $code-color: $brand-primary; 4 | $code-bg: #ebe4f3; 5 | 6 | $font-size-base: 16px; 7 | 8 | $font-family-sans-serif: "Source Sans Pro", Helvetica, Arial, sans-serif; 9 | $font-family-serif: "Raleway", Helvetica, Arial, sans-serif; 10 | 11 | $navbar-default-color: #555; 12 | $navbar-default-bg: transparent; 13 | $navbar-default-border: transparent; 14 | $navbar-margin-bottom: 2em; 15 | 16 | $pre-bg: rgba(0,0,0,0.025); 17 | $pre-border-color: transparent; 18 | -------------------------------------------------------------------------------- /static/source/scss/hl.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | @import "bootstrap"; 3 | @import "typography"; 4 | @import "code"; 5 | @import "home"; 6 | @import "layout"; 7 | -------------------------------------------------------------------------------- /themes/purple/fonts/Haskell.dev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /themes/purple/fonts/Haskell.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/themes/purple/fonts/Haskell.eot -------------------------------------------------------------------------------- /themes/purple/fonts/Haskell.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /themes/purple/fonts/Haskell.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/themes/purple/fonts/Haskell.ttf -------------------------------------------------------------------------------- /themes/purple/fonts/Haskell.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haskell-infra/hl/b022afc2be71ca4ca25f05d6e0327320e07a645b/themes/purple/fonts/Haskell.woff --------------------------------------------------------------------------------