This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Handler.Support where | |
| import Import hiding ((==.)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Handler.Support where | |
| import Import hiding ((==.)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- This compiles fine | |
| getAccountInfoR :: CustomerId -> Handler Html | |
| getAccountInfoR customerId = do | |
| customer_info_list <- runDB $ | |
| E.select $ | |
| E.from $ \c -> do | |
| E.where_ (c ^. CustomerId ==. E.val customerId) | |
| return c | |
| defaultLayout $ do | |
| setTitle "Your Licenses" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Handler.PostNew where | |
| import Import | |
| getPostNewR :: Handler Html | |
| getPostNewR = do | |
| defaultLayout $ do | |
| $(widgetFile "posts/new") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ----------------------------------------------------------------------------------------------------- | |
| -- from http://seanhess.github.io/2015/08/19/practical-haskell-json-api.html | |
| ----------------------------------------------------------------------------------------------------- | |
| {-# LANGUAGE DeriveGeneric #-} | |
| module Main where | |
| import Data.Monoid ((<>)) | |
| import Data.Aeson (FromJSON, ToJSON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE EmptyDataDecls #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeFamilies #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ ghc git:(ghc-stable) ✗ make | |
| ===--- building phase 0 | |
| make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds | |
| make[1]: Nothing to be done for 'phase_0_builds'. | |
| ===--- building phase 1 | |
| make -r --no-print-directory -f ghc.mk phase=1 phase_1_builds | |
| "/usr/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -package-db libraries/bootstrapping.conf -hide-all-packages -i -ighc/. -ighc/st | |
| age1/build -ighc/stage1/build/autogen -Ighc/stage1/build -Ighc/stage1/build/autogen -optP-include -optPghc/stage1/build/autogen/cabal_macro | |
| s.h -package array-0.5.0.0 -package base-4.7.0.2 -package bytestring-0.10.4.0 -package directory-1.2.1.0 -package filepath-1.3.0.2 -package ghc | |
| -7.11 -package process-1.2.0.0 -package unix-2.7.0.1 -Wall -XHaskell2010 -no-user-package-db -rtsopts -odir ghc/stage1/build -hidir ghc/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo dnf install glibc-devel ncurses-devel gmp-devel autoconf automake libtool gcc make perl python ghc happy alex git -y | |
| sudo dnf install docbook-utils docbook-utils-pdf docbook-style-xsl -y | |
| sudo dnf install strace patch -y | |
| git clone --recursive git://git.haskell.org/ghc.git | |
| cd ghc | |
| git checkout ghc-7.10.2-release | |
| git checkout -b ghc-stable | |
| ./boot | |
| ./configure --prefix=$HOME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ ghc git:(ghc-stable) ✗ make | |
| ===--- building phase 0 | |
| make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds | |
| libraries/bin-package-db/ghc.mk:3: libraries/bin-package-db/dist-boot/package-data.mk: No such file or directory | |
| "/usr/bin/ghc" -H32m -O \ | |
| -optc-fno-stack-protector \ | |
| \ | |
| --make utils/ghc-cabal/Main.hs -o utils/ghc-cabal/dist/build/tmp/ghc-cabal \ | |
| -no-user-package-db \ | |
| -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ aleff ghc-pkg list blaze-builder | |
| /usr/lib64/ghc-7.8.4/package.conf.d | |
| /home/hefesto/.ghc/x86_64-linux-7.8.4/package.conf.d | |
| blaze-builder-0.3.3.4 |