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 ConstraintKinds #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| module Iseek.AuthorityMgr.FeatureApi where | |
| import Control.Applicative (pure, (<$>)) | |
| import Control.Category ((.)) |
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 NoImplicitPrelude #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module LdapSearch | |
| ( MatchExpr(..) | |
| , LdapSearch(..) | |
| , (==.) | |
| , (~=.) | |
| , (*~=.) | |
| , (~*=.) | |
| , (*~*=.) |
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
| hush :: Either e a -> Maybe a | |
| hush = either (const Nothing) Just | |
| toId :: JObject -> Maybe Number | |
| toId o = fromNumber <|> fromString | |
| where | |
| fromNumber = hush $ o .? "id" | |
| fromString = do | |
| s <- hush $ o .? "id" | |
| mfilter (isNan >>> not) Just (readFloat s) |
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
| share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| | |
| Success | |
| who Text List | |
| what Text | |
| achievements Text List | |
| |] | |
| -- Generates a table with a single varchar for who / achievements without any error or warning. | |
| -- It just gets completely ignored... |
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
| NAME=$1 | |
| SANDBOX_BASE=$HOME/opt/haskell | |
| SANDBOX_CONF=$SANDBOX_BASE/$NAME.sandbox.config | |
| SANDBOX_DIR=$SANDBOX_BASE/$NAME | |
| rm -fr $SANDBOX_DIR | |
| rm -fr $SANDBOX_CONF | |
| cabal --sandbox-config-file $SANDBOX_CONF sandbox init --sandbox $SANDBOX_DIR | |
| cabal --sandbox-config-file $SANDBOX_CONF install $NAME | |
| ln -s $SANDBOX_DIR/bin/* $HOME/bin/ |
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 OverloadedStrings,TemplateHaskell #-} | |
| module Main (main) where | |
| import Prelude () | |
| import BasePrelude | |
| import Control.Lens | |
| import Control.Monad.State (State,execState) | |
| import Network.Wai.Handler.Warp | |
| import Rest.Driver.Wai (apiToApplication) |
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
| 00:34 <edwardk> spacekitteh: not in 30 seconds or less ;) | |
| 00:37 <edwardk> but the short version of it is that if you take a category, and look at its hom-sets C^op * C -> Set and fix its second argument, so you are looking at the space of all arrows into an object, these spaces of arrows are what we call presheaves (functors from C^op -> Set) the yoneda embedding Y : C -> [ C^op, Set ] is the functor that takes objects in C to their corresponding presheaves in this way. | |
| 00:38 <edwardk> why is that interesting? | |
| 00:39 <edwardk> well, if you look the functor category [X, Y] of functors from X to Y with natural transformations between them as your arrows then you can find that this category inherits most of its structure from Y. | |
| 00:40 <edwardk> [2, Set] is Set^2, its basically pairs of objects for objects, pairs of arrows for arrows, it is cartesian because Set is cartesian, it is cocartesian because set is cocartesian, etc. | |
| 00:40 <edwardk> that suggests that [C^op, Set] acts a lot like Set! | |
| 00:40 <benl23> CCC ft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main where | |
| import Control.Applicative ((<$>)) | |
| import Control.Monad (mfilter) | |
| import Data.Char (toLower,isSpace) | |
| import Data.List (dropWhileEnd,intercalate) | |
| import Data.Time.Clock.POSIX | |
| import Data.Version (versionBranch) | |
| import Distribution.PackageDescription | |
| import Distribution.PackageDescription.Parse |
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
| use strict; | |
| use warnings; | |
| =head1 NAME | |
| create_dbic.pl | |
| =head1 SYNOPSIS | |
| perl maintenaince/create_dbic.pl --help | <options> |
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 OverloadedLists, OverloadedStrings, TupleSections #-} | |
| import Prelude hiding (readFile) | |
| import Control.Applicative ((<$>),(<*>)) | |
| import Control.Error (Script,left,headMay,note,runScript,scriptIO) | |
| import qualified Data.ByteString.Lazy as B | |
| import Data.Char (isDigit) | |
| import Data.Csv (FromNamedRecord,ToNamedRecord,decodeByName,encodeByName | |
| ,namedRecord,parseNamedRecord,toNamedRecord,(.=),(.:)) | |
| import Data.Default (def) |