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 RankNTypes #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE OverloadedStrings #-} |
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
| -- | Look up user locally, then in brig, then return the 'UserId'. If either lookup fails, return | |
| -- 'Nothing'. See also: 'Spar.App.createUser'. | |
| -- | |
| -- ASSUMPTIONS: User creation on brig/galley is idempotent. Any incomplete creation (because of | |
| -- brig or galley crashing) will cause the lookup here to yield invalid user. | |
| getUser :: SAML.UserRef -> Spar (Maybe UserId) | |
| getUser uref = do | |
| muid <- wrapMonadClient $ Data.getUser uref | |
| case muid of |
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
| diff --git a/.travis.yml b/.travis.yml | |
| index 2068d7d..261c7f5 100644 | |
| --- a/.travis.yml | |
| +++ b/.travis.yml | |
| @@ -17,37 +17,43 @@ cache: | |
| - .stack-work | |
| timeout: 1000 | |
| -matrix: | |
| +jobs: |
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
| --- | |
| # Amazon MQ can only be set up in a VPC (created in vpc.yml). However, all | |
| # the other services are running on EC2-Classic, and it's impossible for | |
| # security groups to filter traffic between EC2-VPC and EC2-Classic. | |
| # | |
| # One solution is to leave Amazon MQ accessible on the public internet and | |
| # use credentials for controlling access. We don't want to go this way | |
| # because it's one more set of credentials to maintain. | |
| # |
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 Fedora as the base | |
| FROM fedora:27 | |
| # Install git | |
| RUN dnf -y install git | |
| # Install Stack | |
| ARG STACK_VERSION=1.6.3 | |
| RUN curl -sSfL https://github.com/commercialhaskell/stack/releases/download/v${STACK_VERSION}/stack-${STACK_VERSION}-linux-x86_64-static.tar.gz \ | |
| | tar --wildcards -C /usr/local/bin --strip-components=1 -xzvf - '*/stack' && chmod 755 /usr/local/bin/stack |
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 DeriveGeneric #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| import BasePrelude | |
| import Data.Text (Text) | |
| import Data.ByteString (ByteString) | |
| import qualified Data.ByteString as BS |
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 #-} | |
| {-# LANGUAGE OverloadedLabels #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE DataKinds #-} | |
| import SuperRecord | |
| import Data.Aeson | |
| import Data.ByteString (ByteString) |
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
| -- stack --resolver lts-10.3 --install-ghc runghc --package fmt --package base-prelude --package optparse-applicative --package text | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| {-# LANGUAGE ApplicativeDo #-} | |
| -- | A small program replicating a part of @aws-cli@ (only the interface, | |
| -- not the functionality). | |
| module Main where |
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 TypeApplications #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE MonoLocalBinds #-} | |
| import Generics.Eot | |
| import Data.Char | |
| greadMaybe :: forall a. (HasEot a, EnumType (Eot a)) => String -> Maybe a |
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
| {-# OPTIONS -Wall #-} | |
| {-# LANGUAGE FlexibleContexts #-} -- not all of these are needed | |
| {-# LANGUAGE ViewPatterns #-} | |
| {-# LANGUAGE PatternSynonyms #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeOperators #-} -- really | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} -- don't get scared |