code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.ECS
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brenda... | fmapfmapfmap/amazonka | amazonka-ecs/gen/Network/AWS/ECS.hs | mpl-2.0 | 11,225 | 0 | 5 | 2,632 | 1,073 | 780 | 293 | 233 | 0 |
{-
Copyright 2019 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | alphalambda/codeworld | codeworld-compiler/test/testcases/equationInListComp/source.hs | apache-2.0 | 693 | 3 | 8 | 131 | 62 | 32 | 30 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
module GramLab.Data.Diff.Instances ( Diff (..)
, editList
, editListRev
, editListBidi
, editTree
... | gchrupala/morfette | src/GramLab/Data/Diff/Instances.hs | bsd-2-clause | 1,537 | 0 | 10 | 507 | 464 | 266 | 198 | 39 | 1 |
{-# LANGUAGE FlexibleContexts #-}
-- | Discrete Fourier Transform
module DFT
( dft
, idft
) where
import Prelude ()
import Feldspar
import Feldspar.Data.Vector
-- | Discrete Fourier Transform
dft :: (RealFloat a, PrimType a, PrimType (Complex a)) =>
DPull (Complex a) -> DPull (Complex a)
dft vec = fr... | kmate/raw-feldspar | examples/DFT.hs | bsd-3-clause | 707 | 0 | 16 | 169 | 289 | 149 | 140 | 16 | 1 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, TypeFamilies #-}
module Utils.Point where
type Pt a = (a,a)
instance Num a => Num (Pt a) where
(x1,x2) + (y1,y2) = (x1+y1,x2+y2)
(x1,x2) * (y1,y2) = (x1*y1,x2*y2)
(x1,x2) - (y1,y2) = (x1-y1,x2-y2)
negate (x1,x2) = (negate x1,negate x2)
abs (x... | TomMD/CV | Utils/Point.hs | bsd-3-clause | 628 | 0 | 7 | 141 | 350 | 197 | 153 | 15 | 1 |
{-# language ConstraintKinds #-}
{-# language DataKinds #-}
{-# language FlexibleContexts #-}
{-# language FlexibleInstances #-}
{-# language GeneralizedNewtypeDeriving #-}
{-# language MultiParamTypeClasses #-}
{-# language NamedFieldPuns #-}
{-# language OverloadedStrings #-}
{-# language PackageImports #-}
{-# langu... | joelburget/frankenstein | src/Planetary/Support/Parser.hs | bsd-3-clause | 14,626 | 0 | 26 | 3,306 | 4,378 | 2,208 | 2,170 | 400 | 3 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- Load information on package sources
module S... | kairuku/stack | src/Stack/Build/Source.hs | bsd-3-clause | 22,503 | 0 | 27 | 7,594 | 5,259 | 2,719 | 2,540 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables #-}
-- | Graph coloring register allocator.
module RegAlloc.Graph.Main (
regAlloc
) where
import GhcPrelude
import qualified GraphColor as Color
import RegAlloc.Liveness
import RegAlloc.Graph.Spill
import RegAlloc.Graph.SpillClean
import RegAlloc.Graph.SpillCost
import RegAllo... | ezyang/ghc | compiler/nativeGen/RegAlloc/Graph/Main.hs | bsd-3-clause | 18,575 | 0 | 19 | 7,204 | 2,779 | 1,448 | 1,331 | 281 | 8 |
let foo = 1
bar = baz
quux
in
| ruchee/vimrc | vimfiles/bundle/vim-haskell/tests/indent/test018/test.hs | mit | 49 | 0 | 9 | 26 | 23 | 10 | 13 | -1 | -1 |
module ImgTex (plugin) where
{-
This plugin provides a clear math LaTeX output.
(* latex and dvipng executable must be in the path.)
like this:
~~~ {.dvipng}
\nabla \times \bm{V}
=
\frac{1}{h_1 h_2 h_3}
\begin{vmatrix}
h_1 e_1 & h_2 e_2 & h_3 e_3 \\
\frac{\partial}{\partial q_{1}} &
\frac{\partial}{\pa... | bergmannf/gitit | plugins/ImgTex.hs | gpl-2.0 | 2,092 | 0 | 17 | 462 | 436 | 231 | 205 | 40 | 2 |
-- !!! testing hGetLine
import System.IO
-- one version of 'cat'
main = do
let loop h = do b <- hIsEOF h
if b then return ()
else do l <- hGetLine h; putStrLn l; loop h
loop stdin
h <- openFile "hGetLine001.hs" ReadMode
hSetBinaryMode stdout True
hSetBuffering h N... | ezyang/ghc | libraries/base/tests/IO/hGetLine001.hs | bsd-3-clause | 487 | 1 | 16 | 145 | 178 | 74 | 104 | 16 | 2 |
{-# LANGUAGE MonomorphismRestriction, NoExtendedDefaultRules #-}
module T10971b where
import Data.Traversable (fmapDefault)
f = \x -> length x
g = \f x -> fmapDefault f x
h = \f x -> (fmapDefault f x, length x)
| ezyang/ghc | testsuite/tests/typecheck/should_fail/T10971b.hs | bsd-3-clause | 211 | 0 | 7 | 35 | 71 | 40 | 31 | 6 | 1 |
-- !!! Redefining an imported name
-- was: Imported var clashes with local var definition
module M where
import Prelude(id)
id x = x
| holzensp/ghc | testsuite/tests/module/mod33.hs | bsd-3-clause | 133 | 0 | 5 | 24 | 22 | 14 | 8 | 3 | 1 |
main = print "ok"
| wxwxwwxxx/ghc | testsuite/tests/rts/T7037.hs | bsd-3-clause | 18 | 1 | 4 | 4 | 12 | 4 | 8 | 1 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
module LesserActionSpec where
import Algebra.LesserAction
import Algebra.SemiLatticeAction
import Data.ChatData
import Data.Map (Map)
import Data.Proxy
import Data.... | blargg/crdt | src-test/LesserActionSpec.hs | isc | 1,577 | 0 | 13 | 343 | 389 | 208 | 181 | 28 | 1 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.Enums
(KeyType(..), ToJSVal, FromJSVal, js_KeyTypePublic,
js_KeyTypePrivate, js_KeyTypeSecret, CryptoKeyU... | ghcjs/jsaddle-dom | src/JSDOM/Generated/Enums.hs | mit | 301,388 | 90 | 73 | 176,582 | 27,599 | 15,057 | 12,542 | 4,649 | 1 |
mple :: Int -> Int -> Int
mple m n
| m < 1 || n < 1 = error "m and n must be >= 1"
| n > m = error "n cannot be > m"
| n == m = 1
| n == 1 = m
| n <= m `div` 2 = m
| otherwise = 2 * m - 2 * n
mplo :: Int -> Int -> Int
mplo m n
| m < 1 || n < 1 = error "m and n must be >= 1"
| n > m = error "n cannot ... | RAFIRAF/HASKELL | MaxPalindromeLength.hs | mit | 412 | 3 | 11 | 162 | 290 | 134 | 156 | 16 | 1 |
module AccumulateRight where
import Data.Semigroup
import Test.QuickCheck (Arbitrary, arbitrary, oneof)
import Validation
newtype AccumulateRight a b = AccumulateRight (Validation a b) deriving (Eq, Show)
instance Semigroup b => Semigroup (AccumulateRight a b) where
(AccumulateRight (... | JoshuaGross/haskell-learning-log | Code/Haskellbook/Semigroups/src/AccumulateRight.hs | mit | 694 | 0 | 13 | 143 | 263 | 136 | 127 | 14 | 0 |
import Diagrams.Backend.CmdLine (mainRender)
import Args
import Demos
import TSSMess
import WarActivity
import Wars
main :: IO ()
main = do
args <- parseArgs
case args of
-- demos first
Demo n o -> mainRender o $ selectDemo (Tutorial n)
ADemo n o -> mainRender o $ selectDemo (Arrow' n)
... | mihaimaruseac/petulant-octo-avenger | src-draw/Main.hs | mit | 774 | 0 | 13 | 247 | 276 | 130 | 146 | 20 | 10 |
module Language.LeatherScript.SyntaxDef where
import Control.Arrow
import Control.Applicative
import Control.Lens
import qualified Data.Text as Text
import qualified Data.Vector as Vector
import qualified Data.HashSet as HashSet
im... | pasberth/LeatherScript-prototype | Language/LeatherScript/SyntaxDef.hs | mit | 3,527 | 0 | 33 | 769 | 1,050 | 535 | 515 | 61 | 5 |
{-# LANGUAGE Safe #-}
module Crypto.Pbkdf2 (pbkdf2, pbkdf2_blocks, pbkdf2_iterative, pbkdf2_iterative_blocks) where
import Data.Bits (shiftR)
import Data.Bits (xor)
import Data.Word (Word8, Word32)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as LB
octetsBE :: Word32 -> [Word8]
octetsB... | Ofenhed/LazyPbkdf2 | Crypto/Pbkdf2.hs | mit | 6,563 | 0 | 16 | 1,711 | 948 | 518 | 430 | 55 | 2 |
import Control.Monad (filterM)
import System.Directory (doesFileExist, removeFile)
import System.FilePath (replaceExtension)
import Test.DocTest
import Text.Printf (printf)
numProblems = 99 :: Int
dir = "src"
objectForSource :: String -> String
objectForSource s = replaceExtension s ".o"
removePeskyObjectFiles :: [S... | mvidner/projecteuler | doctests.hs | mit | 1,110 | 2 | 14 | 363 | 342 | 167 | 175 | 29 | 1 |
module Print4 where
myGreeting :: String
myGreeting = "hello" ++ " world!"
hello :: String
hello = "hello"
world :: String
world = "world!"
main :: IO ()
main = do
putStrLn myGreeting
putStrLn secondGreeting
where secondGreeting = concat [hello, " ", world]
| fboyer/haskell-book | chapter3/print4.hs | mit | 268 | 0 | 8 | 53 | 84 | 46 | 38 | 12 | 1 |
import FileTools
import System.FilePath
import qualified Data.ByteString.Lazy.Char8 as B
main = find "/etc" >>= mapM judgeBashFile >>= mapM handleBashFile
judgeBashFile :: FilePath -> IO (String,Bool)
judgeBashFile file = cat file >>= return . (,) file . isBash
where isBash bs = B.take 11 bs == B.pack "#!/bin/bas... | ryuichiueda/UspMagazineHaskell | Study1_Q3/q1_3_8.hs | mit | 652 | 6 | 9 | 137 | 266 | 126 | 140 | 13 | 1 |
data Date = DMY Int Int Int
instance Show Date where
show (DMY d m y) = show d ++ " " ++ show m ++ " " ++ show y
isLeapYear :: Int -> Bool
isLeapYear y = y `mod` 4==0 && (y `mod` 100/=0 || y`mod`400==0)
monthLength :: Int -> Int -> Int
monthLength y m
| m==1 || m==3 || m==5 || m==7 || m==8 || m==10 |... | arekfu/project_euler | p0019/p0019.hs | mit | 1,687 | 18 | 20 | 466 | 842 | 404 | 438 | 38 | 5 |
module Latte.FrontEnd.TypeCheck where
import Control.Monad.Except
import Control.Monad.State
import Data.Map
import qualified Data.Map as Map
import Data.Set
import qualified Data.Set as Set
import Latte.Commons
import Latte.Errors
import Latte.Lang.Abs
data FeTcType
= FnType FeTcType [FeTcType]
| VarType Type
de... | mpsk2/LatteCompiler | src/Latte/FrontEnd/TypeCheck.hs | mit | 3,404 | 116 | 8 | 616 | 667 | 498 | 169 | 88 | 3 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
module Metronome.Types where
import Options.Generic
import qualified Data.Map as M
import Data.Maybe
type SoundMap = M.Map Text Text
type Subdivision = Int
data Options = Options
... | 5outh/metronome | lib/Metronome/Types.hs | mit | 886 | 0 | 9 | 180 | 258 | 146 | 112 | 37 | 1 |
module Rebase.Data.HashMap.Lazy
(
module Data.HashMap.Lazy
)
where
import Data.HashMap.Lazy
| nikita-volkov/rebase | library/Rebase/Data/HashMap/Lazy.hs | mit | 95 | 0 | 5 | 12 | 23 | 16 | 7 | 4 | 0 |
module Y2021.M03.D09.Exercise where
import System.Directory
import System.Environment (getEnv)
{--
Today's #haskell problem: list the contents of a directory and then do
something with each file, like: print the first line of the file.
--}
withDirectoryDo :: FilePath -> (FilePath -> String -> IO ()) -> IO ()
withDir... | geophf/1HaskellADay | exercises/HAD/Y2021/M03/D09/Exercise.hs | mit | 498 | 0 | 11 | 72 | 69 | 39 | 30 | 5 | 1 |
module HsToCoq.Util.Functor ((<&>), passThrough, (.<$), (??)) where
import Control.Lens ((<&>), (??))
passThrough :: Functor f => (a -> f b) -> (a -> f a)
passThrough f = \x -> x <$ f x
{-# INLINABLE passThrough #-}
(.<$) :: Functor f => (f a -> c) -> (a -> f b) -> a -> c
f .<$ g = f . passThrough g
infixr 9 .<$
{-#... | antalsz/hs-to-coq | src/lib/HsToCoq/Util/Functor.hs | mit | 341 | 0 | 10 | 74 | 171 | 97 | 74 | 7 | 1 |
module Main where
import Test.Framework (Test, defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Test.Framework.Providers.HUnit (testCase)
import Test.QuickCheck()
import Test.HUnit (Assertion, assertBool)
import Control.Applicative
import Data.Serialize
import qualified D... | fhaust/aer | test/Main.hs | mit | 3,255 | 0 | 12 | 649 | 741 | 399 | 342 | 57 | 1 |
module Fitness where
-- | Conversion helper
toFloat :: Int -> Float
toFloat = fromIntegral . toInteger
fitness :: Float -> Int -> Int -> Float
fitness coverage towersUsed towersCount = coverage * minimal
where
minimal = 1 - (toFloat towersUsed / toFloat towersCount) | NCrashed/radio-problem | scripts/DefaultFitness.hs | mit | 275 | 0 | 10 | 52 | 80 | 43 | 37 | 6 | 1 |
module Backhand.Modules.Reversi where
import Backhand
import Backhand.Message
import Backhand.Unique
import Control.Concurrent.Chan.Unagi.Bounded
import Data.Maybe
import Game.Reversi
data Reversi = Reversi
{ lightPlayer :: LightPlayer
, darkPlayer :: DarkPlayer
, rBoard :: Board
, turn :: Player
... | quietspace/Backhand | modules/reversi/src/Backhand/Modules/Reversi.hs | mit | 2,218 | 0 | 18 | 704 | 430 | 233 | 197 | 41 | 5 |
-------------------------------------------------------------------------------
-- |
-- Module : System.Hardware.Arduino.SamplePrograms.Morse
-- Copyright : (c) Antoine R. Dumont, Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Morse code blinker. Ori... | aufheben/lambda-arduino | packages/hArduino-0.9/System/Hardware/Arduino/SamplePrograms/Morse.hs | mit | 3,600 | 0 | 12 | 899 | 913 | 544 | 369 | 42 | 4 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module GitMail.App where
import qualified Data.ByteString as BS
import qualified Database.Redis as R
import Network.Wai
import Servant
import Servant.HTML.Blaze
impo... | ShivanKaul/gitmail | github/src/GitMail/App.hs | mit | 997 | 0 | 12 | 294 | 246 | 134 | 112 | 32 | 1 |
module Main where
import Lib
import Control.Exception(catch)
import System.Environment(getProgName)
import System.IO.Error(isUserError)
main :: IO ()
main = ui `catch` handler
handler :: IOError -> IO ()
handler e
| isUserError e = do
progName <- getProgName
putStrLn ("Usage: " ++ pro... | dimus/zones | app/Main.hs | mit | 365 | 0 | 11 | 88 | 126 | 66 | 60 | 13 | 1 |
{-# LANGUAGE FlexibleInstances, UndecidableInstances, OverloadedStrings, TypeFamilies, RankNTypes, DeriveDataTypeable, StandaloneDeriving, FlexibleContexts, TypeSynonymInstances, ScopedTypeVariables, GADTs, GeneralizedNewtypeDeriving, BangPatterns, DeriveGeneric #-}
----------------------------------------------------... | forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Compiler/JMacro/Base.hs | mit | 33,902 | 0 | 21 | 9,637 | 12,039 | 6,164 | 5,875 | 645 | 35 |
{-# LANGUAGE ScopedTypeVariables #-}
module Main (Main.main) where
import GHC.IO.Handle
import GHC.IO.Handle.FD
import qualified Database.SQLite3 as DB
import SQLUtil
import System.Environment
import Control.Concurrent
import qualified Control.Exception as E
import Control.Monad
import System.Time
main :: IO ()
main =... | ducis/haAni | hs/monitor.hs | gpl-2.0 | 2,180 | 8 | 16 | 301 | 500 | 260 | 240 | 35 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import KlaczMonad
import IRC
import Functionality
import Network.Fancy
import Network.FastIRC
import Network.FastIRC.Session
import Control.Monad.State
import Control.Monad.Error
import Control.Applicative
import qualified Data.Map as M
configNickname = return ... | kubov/klacz2 | Main.hs | gpl-3.0 | 1,512 | 0 | 13 | 334 | 417 | 207 | 210 | 53 | 2 |
tupleToElem :: (String, String, Int) -> Element
tupleToElem (n, s, a) = Element { name = n
, symbol = s
, atomicNumber = a } | hmemcpy/milewski-ctfp-pdf | src/content/1.6/code/haskell/snippet16.hs | gpl-3.0 | 190 | 0 | 6 | 91 | 56 | 34 | 22 | 4 | 1 |
{-
Author: Ka Wai
License: GPL 3.0
File: OutputModel_test.hs
Description: tests for outputs generated by OutputModel.hs
-}
module OutputModel_test where
import System.IO
import OutputModel
import Signature
import TestUtils
import Test.HUnit
domainTests = maplabel "Output model domain test... | j5b/ps-pc | OutputModel_test.hs | gpl-3.0 | 6,118 | 0 | 11 | 1,462 | 1,282 | 751 | 531 | 102 | 1 |
--------------------------------------------------------------------------------
-- This file is part of diplomarbeit ("Diplomarbeit Johannes Weiß"). --
-- --
-- diplomarbeit is free software: you can redistribute it and/or modify ... | weissi/diplomarbeit | lib/Data/RAE/Conduit.hs | gpl-3.0 | 10,633 | 0 | 11 | 3,079 | 2,157 | 1,187 | 970 | 167 | 1 |
{- Some types and utilities for cryptography -}
module CryptoChallenge where
import Data.Char (ord, chr)
import Data.Bits (xor, (.&.), shiftR)
import Data.List
import Data.List.Split
type Cipher = [Int]
type Key = [Int]
type Plain = [Int]
aesBlocksize :: Int
aesBlocksize = 0x10 -- Because the standard says so
from... | CharlesRandles/cryptoChallenge | cryptochallenge.hs | gpl-3.0 | 898 | 0 | 11 | 198 | 343 | 190 | 153 | 26 | 1 |
module Scheme.Evaluator.Primitives (
primitives
) where
import Scheme.Internal
import Control.Arrow ((>>>))
--- Functions
primitives :: [(String, [LispVal] -> ThrowsError LispVal)]
primitives = [
-- Core
("equal?", checkNumArg2 $ \x -> \y -> Bool (x == y)),
-- Type checking etc
("number?", checkNumArg1 $ ... | Altech/haScm | src/Scheme/Evaluator/Primitives.hs | gpl-3.0 | 5,166 | 0 | 13 | 1,092 | 2,094 | 1,120 | 974 | 92 | 16 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-adsense-host/gen/Network/Google/Resource/AdSenseHost/CustomChannels/Delete.hs | mpl-2.0 | 3,478 | 0 | 14 | 771 | 381 | 229 | 152 | 67 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-remotebuildexecution/gen/Network/Google/Resource/RemoteBuildExecution/Blobs/GetTree.hs | mpl-2.0 | 8,666 | 0 | 20 | 1,970 | 1,084 | 638 | 446 | 148 | 1 |
module TinyThreePassCompiler where
import Data.Char
import Data.List
import Data.List.Split (splitOn)
import Data.Maybe
import Control.Monad
import Control.Applicative hiding (many, some)
data AST = Imm Int
| Arg Int
| Tmp String
| Add AST AST
| Sub AST AST
| Mul AST AST
... | ice1000/OI-codes | codewars/301-400/tiny-three-pass-compiler.hs | agpl-3.0 | 4,411 | 0 | 13 | 1,301 | 2,281 | 1,181 | 1,100 | 140 | 6 |
module Addition where
import Test.Hspec
import Test.QuickCheck
dividedBy :: Integral a => a -> a -> (a, a)
dividedBy num denom = go num denom 0
where go n d count
| n < d = (count, n)
| otherwise = go (n - d) d (count + 1)
multiplyBy :: Integral a => a -> a -> a
multiplyBy num multi = go num mu... | thewoolleyman/haskellbook | 14/04/maor/addition/Addition.hs | unlicense | 1,913 | 0 | 17 | 521 | 699 | 357 | 342 | 53 | 1 |
-- quicksort, but not in-place
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (pivot:xs) =
let lower = quicksort [x | x <- xs, x <= pivot]
upper = quicksort [x | x <- xs, x > pivot]
in lower ++ [pivot] ++ upper
-- merge two sorted lists into a single sorted list
merge :: (Ord a) => [... | cbare/Etudes | haskell/sort.hs | apache-2.0 | 650 | 0 | 13 | 173 | 366 | 193 | 173 | 18 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Model.Plan
( selectUserPlansSince
, NewPlan(..), createPlan
, updatePlan
, planDone
, planDoneDay
) where
import Prelude
import Yesod
import Con... | samstokes/yesodoro-reboot | Model/Plan.hs | bsd-2-clause | 2,496 | 0 | 15 | 498 | 809 | 426 | 383 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Web.Routes.Quasi.Parse
( -- * Quasi quoter
parseRoutes
, parseRoutesFile
, parseRoutesNoCheck
, parseRoutesFileNoCheck
, Resource (..)
, Piece (..)
) where
import Language.Haskell.TH (appE)
import Langu... | snoyberg/web-routes-quasi | Web/Routes/Quasi/Parse.hs | bsd-2-clause | 4,291 | 2 | 16 | 1,044 | 1,301 | 705 | 596 | 94 | 8 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( withJabaraster
, withDevelAppPort
) where
import Import
import Settings
import Settings.StaticFiles (staticSite)
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Data.Dynamic (Dynamic, toD... | jabaraster/yefib | Application.hs | bsd-2-clause | 2,046 | 0 | 14 | 315 | 381 | 215 | 166 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
module Reflex.Dom.SimpleMDE where
import ... | Haskell-Praxis/hakyll-cms | simple-mde/src/Reflex/Dom/SimpleMDE.hs | bsd-2-clause | 10,026 | 0 | 19 | 2,565 | 1,847 | 1,027 | 820 | 198 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Stashh.Model.Type where
import Control.Applicative
import Data.Maybe
import qualified Data.Vector as V
import Data.Aeson
import Data.List (transpose, intercalate, intersperse, stripPrefix)
data Link = Link
{ linkUrl :: String
, linkRel :: String
}
deriving (Show, Eq)... | yuroyoro/stashh | src/Stashh/Model/Type.hs | bsd-3-clause | 2,555 | 0 | 17 | 944 | 671 | 363 | 308 | 75 | 1 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Ordinal.PL.Corpus
( corpus ) where
import Prelude
import D... | facebookincubator/duckling | Duckling/Ordinal/PL/Corpus.hs | bsd-3-clause | 661 | 0 | 8 | 127 | 111 | 70 | 41 | 16 | 1 |
{-# LANGUAGE TypeFamilies, FlexibleInstances, GADTs, StandaloneDeriving #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : ForSyDe.Atom.MoC.DE.Core
-- Copyright : (c) George Ungureanu, KTH/ICT/ESY 2016
-- License : BSD-style (see... | forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/DE/Core.hs | bsd-3-clause | 7,182 | 0 | 12 | 1,732 | 2,077 | 1,121 | 956 | -1 | -1 |
{-|
Module : Example.Main
Description : Show various examples.
Copyright : (c) Alexander Vieth, 2016
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Arrows #-}
import Prelude hiding ((.), id, ... | avieth/reactive-dom | Examples/Main.hs | bsd-3-clause | 1,186 | 0 | 22 | 238 | 272 | 145 | 127 | 29 | 1 |
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS -Wall -fno-warn-unused-do-bind #-}
module Main (
main
) where
import Control.Applicative ((<$>))
import Control.Monad.Reader
import Data.IORef
import Data.Maybe
import qualified Graphics.UI.Gtk as G
import System.Environment (getArgs)
import Paths_heapscope_cairo as M... | kfish/heapscope-cairo | src/GUI.hs | bsd-3-clause | 5,032 | 0 | 14 | 874 | 1,647 | 798 | 849 | 115 | 2 |
{-# LANGUAGE QuasiQuotes #-}
{-@ LIQUID "--no-termination "@-}
{-@ LIQUID "--short-names "@-}
import LiquidHaskell
import Language.Haskell.Liquid.Prelude (liquidAssert)
import Data.IORef
[lq| data variance IO bivariant |]
[lq| data variance IORef bivariant |]
job :: IO ()
job = do
p <- newIORef (0 :: Int)
... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/contra0.hs | bsd-3-clause | 392 | 0 | 10 | 76 | 109 | 59 | 50 | 12 | 1 |
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Astro.LunarCoordinates (lunarCoordinates) where
import Astro.Time
import Astro.Coords
import Astrodynamics (r_Earth)
import Numeric.Units.Dimensional.Prelude
import Numeric.Units.Dimensional.LinearAlgebra
import Numeric.Units.Dimensional.... | bjornbm/astro | src/Astro/LunarCoordinates.hs | bsd-3-clause | 4,454 | 0 | 22 | 902 | 1,061 | 523 | 538 | 46 | 1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
module Snap.Snaplet.ActionLog.Resource
( actionLogR
, indexH
, showH
, actionLogSplices
, actionLogISplices
) where
------------------... | Soostone/snaplet-actionlog | src/Snap/Snaplet/ActionLog/Resource.hs | bsd-3-clause | 14,118 | 0 | 20 | 3,761 | 3,407 | 1,768 | 1,639 | 255 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Prompt.Ssh
-- Copyright : (C) 2007 Andrea Rossato
-- License : BSD3
--
-- Maintainer : andrea.rossato@unibz.it
-- Stability : unstable
-- Portability : unportable
--
-- A ssh prompt for XMonad
--
--... | eb-gh-cr/XMonadContrib1 | XMonad/Prompt/Ssh.hs | bsd-3-clause | 3,610 | 0 | 17 | 906 | 939 | 491 | 448 | 85 | 2 |
{-
Data types for untyped lambda calculus with and without names.
NB: it's possible to do this and much of boilerplate descents
along recursive data types with Haskell typeclass magic,
see:
* http://dev.stephendiehl.com/hask/#interpreters
* http://dev.stephendiehl.com/hask/#languag... | tomtitchener/TypesAndProgrammingLanguages | src/untyped/data.hs | bsd-3-clause | 1,855 | 2 | 10 | 400 | 379 | 209 | 170 | 24 | 0 |
module Main where
import Hangman
import Test.Hspec
import Test.QuickCheck
-- Preamble
-- Generate match and miss pairs
alphabet :: String
alphabet = ['a'..'z']
isWord :: String -> Bool
isWord w = foldr (\a b -> a `elem` alphabet && b) True w
genMatch :: Gen ([Char], Char)
genMatch = do
xs <- arbitrary `suchTha... | dmvianna/hangman | tests/tests.hs | bsd-3-clause | 2,992 | 0 | 16 | 713 | 922 | 476 | 446 | 64 | 2 |
{-# OPTIONS -Wall -fno-warn-unused-binds #-}
module Benchmark.Euphoria (
benchmark1
, benchmark2
, main
) where
import FRP.Euphoria.Event
import Control.Monad
import Control.Applicative
import Data.Monoid
import Data.Time
import System.Random.MWC
import qualified Data.IntMap as IM
import Text.Printf
import System.I... | tsurucapital/frp-benchmarks | src/Benchmark/Euphoria.hs | bsd-3-clause | 3,009 | 0 | 20 | 767 | 1,052 | 537 | 515 | 76 | 3 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger
import qualified Database... | tanakh/icfp2013-clone | Application.hs | bsd-3-clause | 2,730 | 0 | 12 | 537 | 468 | 254 | 214 | -1 | -1 |
-- |
-- Module : NestedUnfoldOps
-- Copyright : (c) 2019 Composewell Technologies
--
-- License : BSD3
-- Maintainer : streamly@composewell.com
module NestedUnfoldOps where
import Control.Monad.IO.Class (MonadIO (..))
import Streamly.Internal.Data.Unfold (Unfold)
import qualified Streamly.Internal.Data.U... | harendra-kumar/asyncly | benchmark/NestedUnfoldOps.hs | bsd-3-clause | 3,719 | 0 | 17 | 901 | 1,284 | 679 | 605 | 93 | 1 |
module UnSafe
(
hackageUrl,
getUrlFromData
) where
import Config(getDataFromFile,getData,pickerData)
import System.IO.Unsafe
hackageUrlIO :: IO String
hackageUrlIO = do
configData <- getDataFromFile "./.xhsk.home.config"
return . (\(Just x) -> x) $ getData... | Xidian-Haskell-Server-Keeper/XHSK-Home | src/UnSafe.hs | bsd-3-clause | 764 | 0 | 12 | 196 | 186 | 97 | 89 | 18 | 1 |
-- | Module providing a function to parse a page from a file
--
module Hakyll.Web.Page.Read
( readPage
) where
import Control.Applicative ((<$>), (<*>), (<*), (<|>))
import qualified Data.Map as M
import Text.Parsec.Char (alphaNum, anyChar, char, oneOf, string)
import Text.Parsec.Combinator (choice, many1, ma... | sol/hakyll | src/Hakyll/Web/Page/Read.hs | bsd-3-clause | 1,859 | 0 | 14 | 374 | 578 | 315 | 263 | 40 | 2 |
{-# LANGUAGE CPP #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE DeriveDataTypeable #-}
#if __GLASGOW_HASKELL__ >= 704
{-# LANGUAGE DeriveGeneric #-}
#endif
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
#endif
-----------------------------------------------------------------------------
-- |
-- Cop... | treeowl/bound | src/Bound/Var.hs | bsd-3-clause | 7,138 | 0 | 12 | 1,417 | 2,036 | 1,085 | 951 | 140 | 1 |
module DoLet where
main = do
first
second
third
fourth
fifth
sixth
first = do
let x = 123
print x
second = do
let x = 123
x <- return 10
print x
third = do
x <- return 123
let x = 777
print x
fourth = do
x <- return 123
let y = 777
print x
print y
fifth = do
print 123
x <- ... | fpco/fay | tests/doLet.hs | bsd-3-clause | 475 | 0 | 26 | 169 | 247 | 104 | 143 | 38 | 1 |
--------------------------------------------------------------------------------
-- | The LLVM abstract syntax.
--
module Llvm.AbsSyn where
import Llvm.Types
import Unique
-- | Block labels
type LlvmBlockId = Unique
-- | A block of LLVM code.
data LlvmBlock = LlvmBlock {
-- | The code label for this block
... | nomeata/ghc | compiler/llvmGen/Llvm/AbsSyn.hs | bsd-3-clause | 7,525 | 0 | 9 | 2,085 | 511 | 332 | 179 | 59 | 0 |
{-# LANGUAGE Arrows #-}
module Parse.Bitmask where
import Spec.Bitmask
import Parse.Utils
import Text.XML.HXT.Core
import Prelude hiding(elem)
parseBitmask :: IOStateArrow s XmlTree Spec.Bitmask.Bitmask
parseBitmask = hasName "enums" >>> hasAttrValue "type" (== "bitmask") >>>
(extract `orElse` failA... | oldmanmike/vulkan | generate/src/Parse/Bitmask.hs | bsd-3-clause | 2,373 | 3 | 14 | 898 | 483 | 249 | 234 | 43 | 1 |
--module Data.Float.BinString.Test where
{-# LANGUAGE OverloadedStrings #-}
import Data.Float.BinString
import Control.Applicative
import Data.Text (pack,unpack,Text)
import Control.Monad
import Data.Monoid
import Test.Hspec
import Test.QuickCheck
import Test.HUnit
import Test.Hspec.HUnit
import Debug.Trace
rev_p... | llelf/float-binstring | tests/Test.hs | bsd-3-clause | 1,441 | 73 | 8 | 453 | 497 | 269 | 228 | 37 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Snap.Snaplet.OAuth.Github
(
-- * Routes
routes
-- * Handlers
, githubLoginH
, githubCallbackH
, githubUserH
-- * Types and API
, module Snap.Snaplet.OAuth.Github.Api
... | HaskellCNOrg/snaplet-oauth | src/Snap/Snaplet/OAuth/Github.hs | bsd-3-clause | 1,872 | 0 | 9 | 455 | 254 | 157 | 97 | 26 | 1 |
module Network.WaiSpec (spec) where
import Test.Hspec
import Test.Hspec.QuickCheck (prop)
import Network.Wai
import Network.Wai.Internal (Request (Request))
import Data.IORef
import Data.Monoid
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
import Blaze.ByteString.Builder (toByteStrin... | beni55/wai | wai/test/Network/WaiSpec.hs | mit | 3,188 | 0 | 25 | 1,247 | 914 | 455 | 459 | 68 | 2 |
{-# LANGUAGE RecordWildCards #-}
-- | The main goal of this module is to encapsulate recovery mechanism
-- and provide helpers related to it.
module Pos.Infra.Recovery.Info
( CurrentSlot (..)
, TipSlot (..)
, SyncStatus (..)
, MonadRecoveryInfo
, getSyncStatus
, recoveryInPro... | input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/Recovery/Info.hs | mit | 6,138 | 0 | 14 | 1,766 | 993 | 543 | 450 | -1 | -1 |
module BgExplicitVarBind where
f :: Bool
f = True
g = if f then 3 else f
| roberth/uu-helium | test/typeerrors/Examples/BgExplicitVarBind.hs | gpl-3.0 | 75 | 0 | 5 | 19 | 27 | 17 | 10 | 4 | 2 |
{-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses #-}
module Data.Time.Recurrence.AndThen
(
AndThen (..)
)
where
infixr 0 >==>
class AndThen a b c | a b -> c where
(>==>) :: a -> b -> c
| sdiehl/time-recurrence | src/Data/Time/Recurrence/AndThen.hs | lgpl-3.0 | 215 | 0 | 8 | 53 | 58 | 36 | 22 | 7 | 0 |
{-
Copyright 2016 Markus Ongyerth
This file is part of Monky.
Monky is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later v... | Ongy/monky | Monky/Outputs/Unicode.hs | lgpl-3.0 | 1,723 | 0 | 11 | 484 | 424 | 227 | 197 | 22 | 1 |
-----------------------------------------------------------------------------------------
-- |
-- Module : FRP.Yampa.Event
-- Copyright : (c) Antony Courtney and Henrik Nilsson, Yale University, 2003
-- License : BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer : nilsson@cs.yale.edu... | meimisaki/Yampa | src/FRP/Yampa/Event.hs | bsd-3-clause | 12,761 | 0 | 10 | 2,379 | 1,864 | 1,034 | 830 | 93 | 2 |
-----------------------------------------------------------------------------
--
-- The register allocator
--
-- (c) The University of Glasgow 2004
--
-----------------------------------------------------------------------------
{-
The algorithm is roughly:
1) Compute strongly connected components of the basic bloc... | jwiegley/ghc-release | compiler/nativeGen/RegAlloc/Linear/Main.hs | gpl-3.0 | 36,788 | 6 | 29 | 12,994 | 5,713 | 2,911 | 2,802 | -1 | -1 |
{-
(c) The AQUA Project, Glasgow University, 1994-1998
\section[LiberateCase]{Unroll recursion to allow evals to be lifted from a loop}
-}
{-# LANGUAGE CPP #-}
module ETA.SimplCore.LiberateCase ( liberateCase ) where
#include "HsVersions.h"
import ETA.Main.DynFlags
import ETA.Core.CoreSyn
import ETA.Core.CoreUnfold... | alexander-at-github/eta | compiler/ETA/SimplCore/LiberateCase.hs | bsd-3-clause | 13,988 | 0 | 13 | 4,477 | 1,695 | 929 | 766 | 117 | 3 |
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE TypeOperators #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Functor.Contravariant
-- Copyright : (C) 20... | sdiehl/ghc | libraries/base/Data/Functor/Contravariant.hs | bsd-3-clause | 9,248 | 0 | 10 | 1,976 | 2,451 | 1,306 | 1,145 | -1 | -1 |
module Distribution.Simple.Test.Log
( PackageLog(..)
, TestLogs(..)
, TestSuiteLog(..)
, countTestResults
, localPackageLog
, summarizePackage
, summarizeSuiteFinish, summarizeSuiteStart
, summarizeTest
, suiteError, suiteFailed, suitePassed
, testSu... | trskop/cabal | Cabal/Distribution/Simple/Test/Log.hs | bsd-3-clause | 6,072 | 0 | 15 | 1,603 | 1,427 | 795 | 632 | 118 | 4 |
module Options.Applicative.Builder.Completer
( Completer
, mkCompleter
, listIOCompleter
, listCompleter
, bashCompleter
) where
import Control.Applicative ((<$>), pure)
import Control.Exception (IOException, try)
import Data.List (isPrefixOf)
import System.Process (readProcess)
import Options.Applicative... | begriffs/optparse-applicative | Options/Applicative/Builder/Completer.hs | bsd-3-clause | 823 | 0 | 14 | 137 | 278 | 154 | 124 | 23 | 1 |
-- Record construction should fail statically
-- if there are any strict fields,
-- including in the non-record case.
module ShouldFail where
data S = S { x::Int, y:: ! Int }
data T = T Int !Int
data U = U Int Int
s1 = S {} -- Bad
s2 = S { x=3 } -- Bad
s3 = S { y=3 } -- Ok
t = T {} -- Bad
u = U {} ... | sgillespie/ghc | testsuite/tests/typecheck/should_fail/tcfail112.hs | bsd-3-clause | 331 | 2 | 8 | 104 | 114 | 71 | 43 | 13 | 1 |
{-# OPTIONS_GHC -fwarn-unused-imports #-}
module RedundantImport where
-- this import is redundant, but GHC does not spot it
import qualified Foreign.Storable
import Foreign.Storable (Storable, sizeOf, alignment, peek, poke, )
import Foreign.Ptr (castPtr, )
newtype T a = Cons a
instance Storable a => S... | urbanslug/ghc | testsuite/tests/rename/should_fail/T5211.hs | bsd-3-clause | 488 | 0 | 8 | 110 | 153 | 84 | 69 | 11 | 0 |
module HyperStrUse where
f :: (Int, Int) -> Bool -> Int
f (x,y) True = error (show x)
f (x,y) False = x +1
| urbanslug/ghc | testsuite/tests/stranal/sigs/HyperStrUse.hs | bsd-3-clause | 108 | 0 | 7 | 25 | 68 | 38 | 30 | 4 | 1 |
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Hadoop.Protos.ProtocolInfoProtos.ProtocolInfoService
(ProtocolInfoService, protocolInfoService, GetProtocolVersions, GetProtocolSignature, getProtocolVersions... | alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/ProtocolInfoProtos/ProtocolInfoService.hs | mit | 1,897 | 0 | 7 | 191 | 234 | 156 | 78 | 31 | 1 |
module P021Spec where
import qualified P021 as P
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec =
describe "solveBasic" $
it "N未満の友愛数の和" $
map P.solveBasic [0,1,2,500,1000,1500] `shouldBe` [0,0,0,504,504,2898]
| yyotti/euler_haskell | test/P021Spec.hs | mit | 262 | 0 | 8 | 49 | 106 | 63 | 43 | 10 | 1 |
module LinkedList
( LinkedList
, datum
, fromList
, isNil
, new
, next
, nil
, reverseLinkedList
, toList
) where
import Data.List (unfoldr)
data LinkedList a = Nil | Item a (LinkedList a) deriving (Eq, Show)
datum :: LinkedList a -> a
datum (Item x _) = x
datum Nil = error "nil has no entry"
fr... | enolive/exercism | haskell/simple-linked-list/src/LinkedList.hs | mit | 857 | 0 | 9 | 195 | 329 | 174 | 155 | 33 | 2 |
{-# LANGUAGE BangPatterns #-}
module Data.Smashy.Encoding where
import Data.Smashy.Types
import Data.ByteString (ByteString)
import Control.Monad.ST.Strict (runST, ST)
import qualified Data.Vector.Storable as VS
import qualified Data.Vector.Storable.Mutable as VM
import qualifi... | jahaynes/smashy2 | src/Data/Smashy/Encoding.hs | mit | 2,701 | 0 | 17 | 1,063 | 957 | 482 | 475 | 67 | 4 |
module Machine where
import EnigmaChars
import Wheel
import Wheels
import Control.Monad
import Control.Monad.State
-- | An enigma machine is composed of wheels and their positions
data Machine = Machine [Wheel] WheelPositions deriving (Show, Eq)
-- |
encode :: EnigmaChar -> State Machine EnigmaChar
encode c = do
... | Raphexion/SimplifiedEnigmaMachine | Machine.hs | mit | 776 | 0 | 11 | 145 | 262 | 135 | 127 | 21 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Web.GetHandler where
import qualified Data.Text as T
import Web.Spock.Safe hiding (head, SessionId)
import Data.List
import Data.Maybe
import System.Directory (getDirectoryContents)
import Control.Monad.IO.Class (liftIO)
import Web.View
imp... | elfeck/elfeckcom | src/Web/GetHandler.hs | mit | 6,439 | 0 | 23 | 1,853 | 1,874 | 882 | 992 | 173 | 5 |
{-|
Module : Database.Orville.PostgreSQL.Internal.MigrateSequence
Copyright : Flipstone Technology Partners 2016-2019
License : MIT
-}
module Database.Orville.PostgreSQL.Internal.MigrateSequence
( createSequencePlan
, dropSequencePlan
) where
import Control.Monad (guard)
import Data.List (intercalate)
impo... | flipstone/orville | orville-postgresql/src/Database/Orville/PostgreSQL/Internal/MigrateSequence.hs | mit | 1,581 | 0 | 15 | 316 | 371 | 197 | 174 | 30 | 2 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Hacking | codeJam/africa2010/reverseWords/reverseWords.hs | mit | 852 | 0 | 15 | 149 | 203 | 106 | 97 | 11 | 1 |
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-orphans #-}
{-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
module RenameTest where
#ifndef WITH_NOSQL
import qualified Dat... | greydot/persistent | persistent-test/RenameTest.hs | mit | 3,205 | 0 | 15 | 759 | 629 | 328 | 301 | 44 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Data.S3Config
( S3Config
, parse
, regionOf
) where
-- For now, only very little information needs to be extracted from the S3
-- config file, but extracting it into a separate module is consistent with
-- `Data.Romefile` and `Data.Carthage` and avoids dealing with the... | mheinzel/Rome | src/Data/S3Config.hs | mit | 1,101 | 0 | 9 | 268 | 197 | 117 | 80 | -1 | -1 |
-- | Common handler functions.
module Handler.Common where
import Data.FileEmbed (embedFile)
import Import
-- These handlers embed files in the executable at compile time to avoid a
-- runtime dependency, and for efficiency.
getFaviconR :: Handler TypedContent
getFaviconR = do cacheSeconds $ 60 * 60 * 24 * 30 -- cac... | quantum-dan/HasKnowledge | Handler/Common.hs | mit | 828 | 0 | 14 | 248 | 169 | 85 | 84 | 17 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.