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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE OverloadedStrings #-}
module APNS (
pushMessLive,
pushMessTest,
checkFailLive,
checkFailTest
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Data.Binary.Put
import GHC.Word (Word32, Word16)
import Data.Convertible (convert)
import qualified Data.B... | asukharev/apnpush | src/APNS.hs | mit | 4,276 | 0 | 17 | 728 | 1,162 | 588 | 574 | 113 | 2 |
module Handler.Thing where
import Import
import Text.Julius (RawJS (..))
import qualified BuzLogic.Thing as Bzl
import qualified FrontendSupport.Thing.FrontendRoutes as ERoute
import qualified FrontendSupport.Elm as Elm
--TODO error handling
postThingsR :: Handler Value
postThingsR = do
corsSupport
thing <- (... | rpeszek/crud-ex-backend-yesod | Handler/Thing.hs | mit | 3,095 | 0 | 15 | 693 | 749 | 365 | 384 | 79 | 2 |
{-# LANGUAGE ViewPatterns, ImplicitParams, DeriveDataTypeable, TemplateHaskell, DeriveFunctor,DataKinds, TemplateHaskell, GADTs #-}
-- | A world is a set of positioned futures.
-- Each step each Future is fed with its node wich
module World where
-- import System.Random (randomR, StdGen, randomRs, mkStdGen)
import Da... | paolino/touchnet | World.hs | mit | 3,402 | 6 | 16 | 759 | 1,135 | 597 | 538 | 54 | 3 |
{-# LANGUAGE FlexibleInstances #-}
module Language.SystemF.ExpressionSpec where
import Test.Hspec
import Language.Lambda.Util.PrettyPrint
import Language.SystemF.Expression
spec :: Spec
spec = describe "prettyPrint" $ do
it "prints simple variables" $
prettyPrint' (Var "x") `shouldBe` "x"
it "prints simple ... | sgillespie/lambda-calculus | test/Language/SystemF/ExpressionSpec.hs | mit | 2,706 | 0 | 20 | 631 | 996 | 494 | 502 | 58 | 1 |
-- |
-- Module: Parser.EnumGenerator
-- Copyright: (c) 2015-2016 Martijn Rijkeboer <mrr@sru-systems.com>
-- License: MIT
-- Maintainer: Martijn Rijkeboer <mrr@sru-systems.com>
--
-- Generate code for Enum types.
module Parser.EnumGenerator
( getEnumCode
) where
import Control.Monad.State (State)
i... | sru-systems/protobuf-simple | src/Parser/EnumGenerator.hs | mit | 4,803 | 0 | 21 | 1,023 | 1,311 | 661 | 650 | 107 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.TheBook.BookTest
-- Copyright : (c) 2014, Jakub Kozlowski
-- License : MIT
--
-- Maintainer : mail@jakub-kozlowski.com
--
-- Tests for 'Data.TheBook.Book'.
------------------------------------------------... | ggreif/thebook-haskell | tests/Data/TheBook/BookTest.hs | mit | 1,466 | 0 | 11 | 346 | 270 | 151 | 119 | 21 | 1 |
{-# LANGUAGE BangPatterns #-}
module Main
( main
) where
import Data.IntMap.Strict (insert, (!?))
import qualified Relude.Unsafe as U
input :: IO [Int] -- copy-paste
input = pure [1, 0, 18, 10, 19, 6]
data LoopState = LoopState
{ _n :: {-# UNPACK #-}!Int
, _prev :: {-# UNPACK #... | genos/online_problems | advent_of_code_2020/day15/Main.hs | mit | 943 | 0 | 11 | 284 | 369 | 201 | 168 | 28 | 1 |
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Snap.Snaplet.Hasql
( HasPool(..)
, initHasql
, initHasql'
, sessi... | mikeplus64/snaplet-hasql | src/Snap/Snaplet/Hasql.hs | mit | 2,291 | 0 | 12 | 574 | 718 | 364 | 354 | 69 | 2 |
input = readFile "input.txt"
findFloor :: [Char] -> Int
findFloor xs = move 0 xs
move :: Int -> [Char] -> Int
move f [] = f
move f ('(' : xs) = move (f + 1) xs
move f (')' : xs) = move (f - 1) xs
| alexandrnikitin/algorithm-sandbox | haskell/adventofcode/main.hs | mit | 198 | 0 | 7 | 51 | 120 | 62 | 58 | 7 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
module Main where
import Prelude.Compat
import Data.Monoid ((<>))
import Control.Monad (replicateM_, forM)
import Control.Concurrent.STM (atomically, newTVarIO, modifyTVar, readTVar)
import Rx.Disposable
import Test.Hspec
import Test.HUnit (assertEqual)
main :: IO ()
main = hspec... | roman/Haskell-Reactive-Extensions | rx-disposable/test/TestSuite.hs | mit | 4,832 | 0 | 23 | 1,415 | 1,225 | 579 | 646 | 99 | 1 |
#! /usr/bin/env nix-shell
#! nix-shell -p "haskellPackages.ghcWithPackages (p: [p.aeson p.req])"
#! nix-shell -p hydra-unstable
#! nix-shell -i runhaskell
{-
The purpose of this script is
1) download the state of the nixpkgs/haskell-updates job from hydra (with get-report)
2) print a summary of the state suitable fo... | NixOS/nixpkgs | maintainers/scripts/haskell/hydra-report.hs | mit | 22,108 | 0 | 23 | 4,268 | 5,589 | 2,998 | 2,591 | -1 | -1 |
-- Copyright (c) 2016-present, SoundCloud Ltd.
-- All rights reserved.
--
-- This source code is distributed under the terms of a MIT license,
-- found in the LICENSE file.
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
module Kubern... | soundcloud/haskell-kubernetes | lib/Kubernetes/Model/V1/Secret.hs | mit | 1,927 | 0 | 16 | 626 | 373 | 220 | 153 | 49 | 1 |
import System.Environment
import MyLib (primes,numOfDgt)
-- main = print $ answer 1000000
main = do
args <- getArgs
let n = read (args!!0) :: Integer
print $ answer n
-- binary search by sorted list
elemBin :: Ord a => a -> [a] -> Bool
elemBin x xs = helper x xs 0 (length xs -1) where
helper x... | yuto-matsum/contest-util-hs | src/Euler/035.hs | mit | 1,073 | 0 | 13 | 297 | 530 | 276 | 254 | 28 | 2 |
module Types.HasImage where
import Types.GameObjs
import Settings
import Control.Lens
import System.IO.Unsafe --TODO remove these two
import System.Directory
import Debug.Trace
-- | tough to tell where this module stops and ImageIO begins
class HasImageSrc a where
getImageSrc :: a -> String
-- | Instances for... | santolucito/Euterpea_Projects | TransGame/src/Types/HasImage.hs | mit | 1,417 | 0 | 13 | 268 | 374 | 195 | 179 | 30 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-deploymentstyle.html
module Stratosphere.ResourceProperties.CodeDeployDeploymentGr... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/CodeDeployDeploymentGroupDeploymentStyle.hs | mit | 2,504 | 0 | 12 | 206 | 265 | 152 | 113 | 27 | 1 |
{-# OPTIONS -fno-warn-type-defaults #-}
{-| Constants contains the Haskell constants
The constants in this module are used in Haskell and are also
converted to Python.
Do not write any definitions in this file other than constants. Do
not even write helper functions. The definitions in this module are
automatically... | ribag/ganeti-experiments | src/Ganeti/Constants.hs | gpl-2.0 | 133,182 | 0 | 13 | 25,966 | 23,158 | 13,710 | 9,448 | 3,233 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns#-}
{-# LANGUAGE FlexibleInstances,UndecidableInstances#-}
module Mutation where
import Test.QuickCheck
import Test.QuickCheck.Gen
import Test.QuickCheck.Gen.Unsafe
-- | Mutation Class
class Mutation a where
--mutt' :: Int -> a -> Gen a
mutt :: a ->... | fcostantini/QuickFuzz | src/Mutation.hs | gpl-3.0 | 630 | 0 | 9 | 124 | 157 | 91 | 66 | 13 | 0 |
module Etl where
import Data.Char (toLower)
import Data.Map (Map, assocs, fromList)
transform :: Map Int String -> Map Char Int
transform = fromList . concatMap (\(k,vs) -> zip (map toLower vs) (repeat k)) . assocs
| ciderpunx/exercismo | src/Etl.hs | gpl-3.0 | 216 | 0 | 12 | 36 | 98 | 54 | 44 | 5 | 1 |
{- ============================================================================
| Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> |
| |
| This file is part of Fallback. |
... | mdsteele/fallback | src/Fallback/View/Hover.hs | gpl-3.0 | 6,171 | 0 | 17 | 1,814 | 1,620 | 796 | 824 | 109 | 23 |
-- HsParser: A Parsec builder, a toy for experimenting things:
-- @2013 Angel Alvarez, Felipe Zapata, from The ResMol Group
module ParsecNumbers where
import Data.Char
import Data.Either
import Control.Monad
import Text.Parsec
import Text.Parsec.Char
import Text.Parsec.Combinator
import ParsecCommon
-- Some sil... | AngelitoJ/HsParser | src/ParsecNumbers.hs | gpl-3.0 | 3,812 | 0 | 17 | 1,036 | 880 | 462 | 418 | 80 | 3 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 karamellpelle@hotmail.com
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the Lice... | karamellpelle/grid | designer/source/Game/Shade.hs | gpl-3.0 | 1,323 | 0 | 4 | 289 | 173 | 114 | 59 | 36 | 1 |
module Simulate where
import Control.Applicative ((<*>))
import Control.Monad (foldM_)
import Data.List ((\\))
import Data.IORef
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import Cards
import Evaluate
import Util (shuffleTo)
-- |Player datatype where rows are encode... | dtrifuno/holz | src/Simulate.hs | gpl-3.0 | 3,771 | 0 | 13 | 831 | 1,564 | 787 | 777 | 88 | 4 |
{-# LANGUAGE ScopedTypeVariables #-}
module AST.Grad (grad') where
import Prelude hiding ((<*))
import Data.Array.Accelerate.Smart
import Data.Array.Accelerate.Tuple (Tuple(..), IsTuple, TupleRepr, fromTuple, toTuple, TupleIdx(..))
import Data.Array.Accelerate
import Unsafe.Coerce
import Types
import System.IO.Unsafe
... | johncant/accelerate-symdiff | src/AST/Grad.hs | gpl-3.0 | 2,763 | 0 | 9 | 711 | 217 | 150 | 67 | 16 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Organizations/Sinks/Create.hs | mpl-2.0 | 6,962 | 0 | 18 | 1,486 | 881 | 520 | 361 | 125 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-games/gen/Network/Google/Resource/Games/Rooms/Get.hs | mpl-2.0 | 2,823 | 0 | 13 | 693 | 385 | 231 | 154 | 57 | 1 |
data Tree a = Node (Tree a) (Tree a)
| Leaf a
deriving (Show)
treeLengths (Leaf s) = Leaf (length s)
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
treeMap :: (a -> b) -> Tree a -> Tree b
treeMap f (Leaf a) = Leaf (f a)
treeMap f (Node l r) = Node (treeMap f l) (treeMap... | caiorss/Functional-Programming | haskell/rwh/ch10/TreeMap.hs | unlicense | 610 | 6 | 10 | 165 | 293 | 146 | 147 | -1 | -1 |
-- |
-- Module : Network.MicrosoftAzure.ACS
-- Description : API for requesting password token from Windows Azure ACS.
-- Copyright : (c) Hemanth Kapila, 2014
-- License : BSD3
-- Maintainer : saihemanth@gmail.com
-- Stability : Experimental
--
-- Provides API to request password token from WindowsAzure ACS. The secur... | kapilash/hs-azure | azure-acs/Network/MicrosoftAzure/ACS.hs | apache-2.0 | 4,484 | 0 | 15 | 814 | 854 | 469 | 385 | 79 | 2 |
module TestSafePrelude where
import Test.HUnit
import SafePrelude
testSafeHeadForEmptyList :: Test
testSafeHeadForEmptyList = TestCase $ assertEqual "Should Return Nothing for Empty List " Nothing (safeHead ([] :: [Int]))
testSafeHeadForNonEmptyList :: Test
h = safeHead ([1])
testSafeHeadForNonEmptyList = TestCase $... | dongarerahul/edx-haskell | parser/test/TestSafePrelude.hs | apache-2.0 | 494 | 0 | 10 | 65 | 117 | 65 | 52 | 10 | 1 |
module Bindrop.Routes where
import Control.Monad
import Control.Monad.IO.Class
import Control.Lens.Operators
import Data.Acid
import Data.Acid.Advanced ( query' )
import Happstack.Server
import Happstack.Server.ClientSession
import Bindrop.Session
import Bindrop.State
import Bindrop.State.Journal
import Bindrop.Res... | mcmaniac/bindrop | src/Bindrop/Routes.hs | apache-2.0 | 2,680 | 0 | 16 | 804 | 623 | 319 | 304 | 65 | 1 |
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS -Wall #-}
----------------------------------------------------------------------
-- |
-- Module : Data.ZoomCache.Dump
-- Copyright : Conrad Parker
-- License : BSD3-style (see LICENSE)
--
-- Maintainer :... | kfish/zoom-cache | Data/ZoomCache/Dump.hs | bsd-2-clause | 3,178 | 0 | 12 | 645 | 947 | 487 | 460 | 60 | 2 |
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Graphics.GL.TextBuffer.Input... | lukexi/text-gl | src/Graphics/GL/TextBuffer/Input.hs | bsd-2-clause | 8,267 | 0 | 18 | 2,265 | 1,752 | 913 | 839 | -1 | -1 |
-- |
--
-- Copyright:
-- This file is part of the package byline. It is subject to the
-- license terms in the LICENSE file found in the top-level
-- directory of this distribution and at:
--
-- https://github.com/pjones/byline
--
-- No part of this package, including this file, may be copied,
-- modified... | pjones/byline | src/Byline/Exit.hs | bsd-2-clause | 1,700 | 0 | 13 | 387 | 277 | 163 | 114 | 27 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QTextLength.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:35
Warning : this file is machine generated - do n... | keera-studios/hsQt | Qtc/Enums/Gui/QTextLength.hs | bsd-2-clause | 2,575 | 0 | 18 | 532 | 612 | 313 | 299 | 55 | 1 |
module Data.AutoStack.Example.Util where
-- | In separate module due to GHC stage restrictions
-- [a,b,c,d] -> [a,b,c]
dropLast :: [a] -> [a]
dropLast s = take (length s - 1) s
| jotrk/autostack | Data/AutoStack/Example/Util.hs | bsd-2-clause | 178 | 0 | 8 | 32 | 48 | 28 | 20 | 3 | 1 |
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-}
{-# OPTIONS_GHC -fcontext-stack41 #-}
module Games.Chaos2010.Database.Scalars where
import Games.Chaos2010.Database.Fields
import Database.HaskellDB.DBLayout
type Scalars =
Record (HCons (LVPair Scalar_name (Expr (Maybe String))) HNil)
scalars :: Table Sca... | JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Scalars.hs | bsd-3-clause | 354 | 0 | 13 | 44 | 76 | 44 | 32 | 9 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Trombone.Dispatch.Core
( Context(..)
, HmacKeyConf(..)
, LoggerConf(..)
, Dispatch
, escVal
, escVal'
, quoute
, filterNot
, params
, sanitize
, printS
, logS
, logSql
) where
import Co... | johanneshilden/trombone | Trombone/Dispatch/Core.hs | bsd-3-clause | 5,028 | 0 | 12 | 1,487 | 1,235 | 687 | 548 | 110 | 3 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
-- |Monadic Iteratees: incremental input parsers, processors, and transformers
--
-- Maps over restricted-element containers
module Data.Iteratee.Base.LooseMap (
LooseMap (..)
)
where
-- |Enable map functions for containers that require class contexts on t... | iteloo/tsuru-sample | iteratee-0.8.9.6/src/Data/Iteratee/Base/LooseMap.hs | bsd-3-clause | 504 | 0 | 9 | 88 | 81 | 47 | 34 | 7 | 0 |
module AstTransform(normaliseAst,transformToInstructions) where
import Ast
import Instructions
normaliseAst :: Program -> Program
normaliseAst = checkReturnStatement . normaliseStatements . checkTree
--throw errors if an error in the grammar is found
--returns the exact same AST if no errors were found
checkTree :: ... | fegies/pseudocodeCompiler | src/AstTransform.hs | bsd-3-clause | 7,071 | 6 | 14 | 1,211 | 2,104 | 1,053 | 1,051 | 133 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Utils.Scotty.CSRF(
generateCSRF
) where
import Codec.Crypto.SimpleAES
import Data.ByteString
import qualified Data.ByteString.Char8 as C8
import qualified Data.Text as T
import Data.ByteString.Base64.URL
import Data.String.Conversions
generateCSRF :: String -> IO T.Te... | DavidAlphaFox/sblog | src/Utils/Scotty/CSRF.hs | bsd-3-clause | 463 | 0 | 12 | 75 | 138 | 78 | 60 | 14 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.GHC
-- Copyright : Isaac Jones 2003-2007
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is a fairly large module. It contains most of the... | plumlife/cabal | Cabal/Distribution/Simple/GHC.hs | bsd-3-clause | 49,664 | 8 | 26 | 15,296 | 9,360 | 4,920 | 4,440 | 787 | 17 |
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE UnboxedTuples #-}
#include "inline.hs"
-- |
-- Module : Streamly.Internal.FileSystem.File
-- ... | harendra-kumar/asyncly | src/Streamly/Internal/FileSystem/File.hs | bsd-3-clause | 21,236 | 0 | 14 | 3,829 | 1,845 | 1,096 | 749 | 123 | 1 |
module AST.Module
( Module(..), Header(..)
, UserImport(..), ImportMethod(..)
) where
import qualified AST.Declaration as Declaration
import qualified AST.Module.Name as Name
import qualified AST.Variable as Var
import qualified Reporting.Annotation as A
import AST.V0_16
-- MODULES
data Module = Module... | fredcy/elm-format | parser/src/AST/Module.hs | bsd-3-clause | 1,521 | 0 | 13 | 394 | 430 | 252 | 178 | 40 | 0 |
{-# LANGUAGE RebindableSyntax #-}
-- Copyright : (C) 2009 Corey O'Connor
-- License : BSD-style (see the file LICENSE)
import Bind.Marshal.Prelude
import Bind.Marshal.Verify
import Bind.Marshal.StdLib.Dynamic.ByteString.Lazy.Ser
main = run_test $ do
returnM () :: Test ()
| coreyoconnor/bind-marshal | test/verify_stdlib_dynamic_bytestring_lazy_ser.hs | bsd-3-clause | 288 | 0 | 9 | 51 | 51 | 31 | 20 | 6 | 1 |
module Rules.BinaryDist where
import Expression
import GHC
import Oracles.Setting
import Settings
import Target
import Utilities
bindistRules :: Rules ()
bindistRules = do
root <- buildRootRules
phony "binary-dist" $ do
-- We 'need' all binaries and libraries
targets <- mapM pkgTarget =<< stagePac... | bgamari/shaking-up-ghc | src/Rules/BinaryDist.hs | bsd-3-clause | 4,431 | 0 | 16 | 1,036 | 722 | 383 | 339 | 70 | 1 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving, TemplateHaskell #-}
module Text.InputMethod.SKK.Dictionary
(Dictionary(..), Input(..), Candidate(..),
gokan, okurigana, emptyDic, lookup,
tango, chushaku, dictionary, mergeDic,
... | konn/hskk | src/Text/InputMethod/SKK/Dictionary.hs | bsd-3-clause | 9,621 | 0 | 17 | 2,494 | 3,368 | 1,788 | 1,580 | -1 | -1 |
-- | The expected size strategy keeps a pool of possible secret codes around.
-- After each guess the inconsistent codes are removed from the pool.
--
-- From the pool of all codes a subpool of codes is determined. This subpool
-- contains the codes which would lead to a maximized expected payoff. If
-- possible this s... | eugenkiss/mastermind | haskell/Strategies/Expected.hs | bsd-3-clause | 2,862 | 0 | 16 | 834 | 646 | 346 | 300 | 41 | 2 |
module Exercises6 where
import Data.List
--Multiple Choice
--1. c
--2. b
--3. a
--4. c
--5. a
--Does it Typecheck?
--1. No. Person type needs to be an instance of Show
data Person = Person Bool
deriving Show
printPerson :: Person -> IO ()
printPerson person = putStrLn (show person)
--2. No. Mood n... | pdmurray/haskell-book-ex | src/ch6/Exercises6.hs | bsd-3-clause | 2,818 | 0 | 8 | 696 | 551 | 316 | 235 | 45 | 2 |
module GUI.SummaryView (
SummaryView,
summaryViewNew,
summaryViewSetEvents,
summaryViewSetInterval,
) where
import GHC.RTS.Events
import GUI.Types
import Graphics.UI.Gtk
import Control.Exception (assert)
import Control.Monad
import Data.Array
import qualified Data.IntMap as IM
import Data.IORef
im... | ml9951/ThreadScope | GUI/SummaryView.hs | bsd-3-clause | 39,966 | 0 | 32 | 13,219 | 8,289 | 4,374 | 3,915 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# LANGUAGE CPP ... | Lainepress/easy | Text/RE/TDFA/ByteString.hs | bsd-3-clause | 3,205 | 0 | 9 | 868 | 691 | 410 | 281 | 79 | 1 |
import System.TimeitHs
import Control.Concurrent
import Data.List
nothingFunc :: IO ()
nothingFunc = return ()
loopFunc :: IO Integer
loopFunc = do
-- break that lazyness
let v = foldl' (+) 0 [1..100000000]
print v
return v
sleepFunc :: IO ()
sleepFunc = do
threadDelay $ 5 * 1000000
main :: IO (... | adarqui/timeit-hs | examples/timeit.hs | bsd-3-clause | 532 | 0 | 11 | 127 | 186 | 88 | 98 | 21 | 1 |
---------------------------------------------------------
--
-- Module : FinancingConfiguration
-- Copyright : Bartosz Wójcik (2010)
-- License : All rights reserved
--
-- Maintainer : bartek@sudety.it
-- Stability : Unstable
-- Portability : portable
--
-- Financing configuration.
... | bartoszw/haslo | Haslo/FinancingConfiguration.hs | bsd-3-clause | 3,496 | 0 | 7 | 1,642 | 396 | 209 | 187 | 87 | 1 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes, ScopedTypeVariables #-}
module RunSpec where
import Test.Hspec
import Test.QuickCheck hiding (Result)
import Control.Applicative
import Control.Concurrent.Thread
import Control.Exception
import Control... | soenkehahn/nhc | test/RunSpec.hs | bsd-3-clause | 8,596 | 0 | 22 | 2,171 | 2,105 | 1,048 | 1,057 | 158 | 1 |
{-# OPTIONS_GHC -fno-cse #-}
module Data.RDF.Utils (
FastString(uniq, value),
mkFastString, equalFS, compareFS,
s2b, b2s, hPutStrRev, hPutStrLnRev,
canonicalize, maybeHead
) where
import qualified Data.ByteString.Lazy as BL
import Data.ByteString.Lazy.Char8(ByteString)
import qualified Data.ByteString.Lazy.... | amccausl/RDF4H | src/Data/RDF/Utils.hs | bsd-3-clause | 5,984 | 0 | 17 | 1,153 | 1,065 | 590 | 475 | 99 | 2 |
{-# LANGUAGE OverloadedStrings #-}
-- | Load the config data from the individual deploy.yaml files.
module Config
( Deploys
, Deploy (..)
, Webapp (..)
, Static (..)
, Postgres (..)
, loadDeploys
, WebappFinal (..)
, webappFinals
) where
import Prelude hiding (FilePath, writeFile)
i... | yesodweb/deploy | src/Config.hs | bsd-3-clause | 4,524 | 0 | 17 | 1,337 | 1,281 | 684 | 597 | 121 | 4 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DeriveGeneric #-} -- Hashable
module Sky.Parsing.Inverti... | xicesky/sky-haskell-playground | src/Sky/Parsing/Invertible2.hs | bsd-3-clause | 9,235 | 0 | 13 | 2,136 | 2,670 | 1,389 | 1,281 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Web.RTBBidder.Types.Response (Response(..)) where
import qualified Data.Aeson as AESON
import Data.Aeson ((.=), (.:), (.:?), (.!=))
import qualified Data.Text as TX
import Web.RTBBidder.Types.Response.SeatBid (SeatBid(..))
data Response = Res... | hiratara/hs-rtb-bidder | src/Web/RTBBidder/Types/Response.hs | bsd-3-clause | 1,124 | 0 | 12 | 248 | 360 | 204 | 156 | 34 | 0 |
module HSync.Client.Types where
import qualified System.FilePath as FP
import System.FilePath.GlobPattern(GlobPattern)
import HSync.Client.Import.NoFoundation
import Control.Lens
import qualified Data.Text as T
import Data.Yaml
--------------------------------------------------------------------------------
-- | An ... | noinia/hsync-client | src/HSync/Client/Types.hs | bsd-3-clause | 4,072 | 0 | 16 | 1,278 | 837 | 455 | 382 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
-----------------------------------------------------------------------------
-- |
-- Module : Miso.FFI.SSE
-- Copyright : (C) 2016-2018 David M. Johnson
-- License ... | dmjio/miso | src/Miso/FFI/SSE.hs | bsd-3-clause | 1,240 | 0 | 11 | 220 | 224 | 134 | 90 | 22 | 1 |
--
--
--
----------------
-- Exercise 4.3.
----------------
--
--
--
module E'4''3 where
import Test.QuickCheck ( quickCheck )
-- From subchapter 3.2, Relational operators (example):
threeEqual :: Integer -> Integer -> Integer -> Bool
threeEqual a b c
| a == b
&& b == c = True
| otherwise ... | pascal-knodel/haskell-craft | _/links/E'4''3.hs | mit | 1,507 | 0 | 12 | 416 | 389 | 202 | 187 | 33 | 1 |
{-# LANGUAGE ConstrainedClassMethods #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies ... | s9gf4ult/yesod | yesod-auth/Yesod/Auth/Email.hs | mit | 35,329 | 582 | 11 | 12,108 | 5,645 | 3,258 | 2,387 | -1 | -1 |
module Reexport where
import Reexport2
main :: Int
main = y
| roberth/uu-helium | test/correct/Reexport.hs | gpl-3.0 | 62 | 0 | 4 | 13 | 17 | 11 | 6 | 4 | 1 |
{-# LANGUAGE RecordWildCards #-}
-- | This module provides datatypes representing TAG trees.
-- `Tree` is an initial tree, while `AuxTree` represents an auxiliary
-- tree.
module NLP.Partage.Tree
(
-- * Initial tree
Tree (..)
-- , showTree
-- , showTree'
, project
-- * Auxiliary tree
, AuxTree (..)
-- ** Path
, ... | kawu/partage | src/NLP/Partage/Tree.hs | bsd-2-clause | 3,363 | 0 | 10 | 808 | 485 | 289 | 196 | 37 | 2 |
import Report
import Control.Monad.Trans
import Network
import NetParts
a :: Why Int
a = do
g <- Why Complete 20
Why Complete (10 + g)
b :: Why Int
b = do
g <- Why Complete 20
Why (Wrong [Report NoPos "Error!"]) 'A'
Why Complete (10 + g)
c = do
i <- Why Complete (putStr "Hello")
j <- Why ... | balangs/eTeak | misc-hs/why-network-examples.hs | bsd-3-clause | 826 | 9 | 11 | 272 | 396 | 176 | 220 | 40 | 1 |
-- |
-- Module : Crypto.Cipher.Types.Block
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : Stable
-- Portability : Excellent
--
-- Block cipher basic types
--
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ViewPatterns... | vincenthz/cryptonite | Crypto/Cipher/Types/Block.hs | bsd-3-clause | 10,199 | 0 | 15 | 3,217 | 2,237 | 1,172 | 1,065 | 144 | 2 |
{-# LANGUAGE OverloadedStrings, RankNTypes, RecordWildCards,
ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-missing-signatures
-fno-warn-unused-binds #-}
module UnitTests (testWith) where
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO, killThread)
import ... | bitemyapp/wreq | tests/UnitTests.hs | bsd-3-clause | 15,818 | 0 | 23 | 3,753 | 5,043 | 2,525 | 2,518 | -1 | -1 |
{-# OPTIONS -fno-warn-name-shadowing #-}
-- | Forms.
module Graphics.UI.Threepenny.Forms where
import Control.Monad
import Data.List.Extra
import Graphics.UI.Threepenny
import Graphics.UI.Threepenny.DOM
import Graphics.UI.Threepenny.Elements
-- | Make a form and do stuff with it.
withForm :: MonadTP m
=> S... | yuvallanger/threepenny-gui | src/Graphics/UI/Threepenny/Forms.hs | bsd-3-clause | 3,692 | 0 | 23 | 1,194 | 1,157 | 553 | 604 | 83 | 3 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
module Control.Effect.Coroutine where
import Control.Applicative
import Data.Functor.Identity
import Control.Effect
import Control.Monad.Free.Church
import Control.Monad.Trans.Cont
data Yield a v = Yield a v
deriving (Functor)
data Coroutine m a
=... | ocharles/interpreters | Control/Effect/Coroutine.hs | bsd-3-clause | 852 | 0 | 15 | 275 | 284 | 154 | 130 | 27 | 1 |
check :: [Int] -> [Int] -> Int -> String
check [] _ _ = "YES"
check (x:xs) stack lower = if x < lower then "NO"
else check xs new_stack new_lower
where (first, second) = break (>= x) stack
new_lower = if null first then lower else ... | zeyuanxy/hacker-rank | practice/fp/ds/valid-bst/valid-bst.hs | mit | 708 | 0 | 10 | 298 | 278 | 144 | 134 | 13 | 3 |
module Distribution.Server.Framework.ServerEnv where
import Distribution.Server.Framework.BlobStorage (BlobStorage)
import Distribution.Server.Framework.Logging (Verbosity)
import Distribution.Server.Framework.Cron (Cron)
import Distribution.Server.Framework.Templating (TemplatesMode)
import qualified Network.URI as ... | agrafix/hackage-server | Distribution/Server/Framework/ServerEnv.hs | bsd-3-clause | 2,472 | 0 | 10 | 501 | 186 | 133 | 53 | 19 | 0 |
{-# LANGUAGE RecursiveDo,ViewPatterns #-}
module E.PrimOpt(performPrimOpt) where
import Control.Monad.Fix()
import C.Prims
import Cmm.OpEval
import Doc.DocLike
import Doc.PPrint
import E.E
import E.Values
import Stats
import StringTable.Atom
import Support.CanType
import qualified Cmm.Op as Op
{-@Extensions
# Forei... | hvr/jhc | src/E/PrimOpt.hs | mit | 4,569 | 0 | 18 | 1,196 | 1,122 | 571 | 551 | -1 | -1 |
-- Lots of weird examples to test strange corner cases of QuickCheck,
-- especially exception handling and ctrl-C handling.
{-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-}
module Main where
import Test.QuickCheck
import Test.QuickCheck.Property
import Test.QuickCheck.Function
import Test.QuickCheck.All
prop = ... | srhb/quickcheck | tests/Weird.hs | bsd-3-clause | 2,729 | 1 | 13 | 509 | 1,038 | 557 | 481 | -1 | -1 |
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module T16826 where
import Data.Kind
type family Id (x :: Type) :: Type where
Id x = x
type C :: Type -> Id Constraint
class C a
| sdiehl/ghc | testsuite/tests/saks/should_fail/T16826.hs | bsd-3-clause | 267 | 0 | 6 | 50 | 57 | 35 | 22 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Parser (
parseExpr,
parseModule
) where
import Text.Parsec
import Text.Parsec.Text.Lazy (Parser)
import qualified Text.Parsec.Expr as Ex
import qualified Text.Parsec.Token as Tok
import qualified Data.Text.Lazy as L
import Lexer
import Syntax
integer :: Parser Integer... | yupferris/write-you-a-haskell | chapter7/poly_constraints/src/Parser.hs | mit | 2,883 | 0 | 13 | 685 | 1,160 | 563 | 597 | 127 | 1 |
{-# LANGUAGE Safe #-}
module Main where
import M_SafePkg
main = do
putStrLn $ show bigInt
| ghc-android/ghc | testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly01.hs | bsd-3-clause | 97 | 0 | 8 | 23 | 23 | 13 | 10 | 5 | 1 |
{-# LANGUAGE BangPatterns #-}
-- | The pure interface for histograms.
-- This module is typically not as useful as the stateful implementation
-- since reservoir updates require retrieving the current time.
module Data.Metrics.Histogram.Internal (
Histogram,
histogram,
clear,
update,
mean,
stddev,
varianc... | iand675/metrics | src/Data/Metrics/Histogram/Internal.hs | mit | 4,029 | 0 | 11 | 926 | 956 | 539 | 417 | 89 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module AMD64CodeGenerator where
import Imp as I
-- For testing START
import Data.Either
import FastoCodeGenerator as FCG hiding (compileExp, compileFun)
import FastoParser as FP
import Control.Monad.State.Lazy
import RegAlloc
-- For testing END
import AMD64
-- ncsr is Number of Call... | Sword-Smith/hfasto | src/AMD64CodeGenerator.hs | mit | 5,182 | 0 | 17 | 1,793 | 1,748 | 886 | 862 | 93 | 1 |
{-# Language TypeSynonymInstances #-}
{-# Language OverloadedStrings #-}
module Unison.Test.Index where
import Control.Concurrent.STM (atomically)
import Data.ByteString.Char8
import System.Random
import Test.QuickCheck
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Unison.Runtime.Addres... | nightscape/platform | node/tests/Unison/Test/Index.hs | mit | 3,223 | 0 | 18 | 607 | 1,126 | 574 | 552 | 77 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module View.Register where
import Control.Monad
import Data.Char
import Data.Maybe (isNothing)
import Data.Text (Text)
import qualified Da... | winterland1989/jsmServer | src/View/Register.hs | mit | 2,021 | 0 | 20 | 586 | 526 | 268 | 258 | 46 | 1 |
module Unison.Test.Typechecker.Components where
import Test.Tasty
import Test.Tasty.HUnit
import Unison.Parsers (unsafeParseTerm)
import qualified Unison.Codebase as Codebase
import qualified Unison.Note as Note
import qualified Unison.Term as Term
import qualified Unison.Test.Common as Common
import qualified Unison.... | nightscape/platform | shared/tests/Unison/Test/Typechecker/Components.hs | mit | 1,842 | 0 | 18 | 515 | 293 | 163 | 130 | 32 | 1 |
{-# LANGUAGE PackageImports #-}
import "yesod-tutorial" Application (develMain)
import Prelude (IO)
main :: IO ()
main = develMain
| KasperJanssens/yesod-tutorial | app/devel.hs | mit | 132 | 0 | 6 | 19 | 34 | 20 | 14 | 5 | 1 |
--------------------------------------------------------------------
-- |
-- Module : My.Data.List
-- Copyright : 2009 (c) Dmitry Antonyuk
-- License : MIT
--
-- Maintainer: Dmitry Antonyuk <lomeo.nuke@gmail.com>
-- Stability : experimental
-- Portability: portable
--
-- List related utilities.
--
-----------... | lomeo/my | src/My/Data/List.hs | mit | 968 | 0 | 11 | 197 | 187 | 114 | 73 | 11 | 2 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Endpoints (tourServer) where
import Data.Aeson
import Data.Text
import GHC.Generics
import Servant
import Servant.API
data Tour = Tour { name :: String }
deriving (Eq, Show, Generic)
sampleTours :: [Tour]
sampleTours ... | vape-nation/owt-api | src/Endpoints.hs | mit | 635 | 0 | 8 | 101 | 177 | 99 | 78 | 22 | 1 |
programInputFromLine x = map (\n -> n*2) . map (read :: String -> Int) . words $ x
main = do
input <- getLine
print . programInputFromLine $ input
| phughk/AlgorithmShowdown | hackerrank/Functional Programming/Recursion/pascals-triangle/haskell/solution.hs | mit | 156 | 0 | 11 | 38 | 72 | 36 | 36 | 4 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Concurrent (threadDelay)
import Control.Monad
import qualified Data.ByteString.Char8 as B8
import System.Environment
import System.Exit
import Kafka
main :: IO ()
main = do
args <- getArgs
when (... | abhinav/kafka-client | examples/consoleConsumer.hs | mit | 1,033 | 0 | 15 | 304 | 319 | 161 | 158 | 28 | 1 |
{-# LANGUAGE FlexibleContexts, TupleSections, FlexibleInstances, MultiParamTypeClasses, LambdaCase, ExistentialQuantification #-}
module Parser (parseFile) where
import Parser.Ast
import GlobalAst (SourceLoc(..), SourceRange(..), TSize(..), BinOp(..), UnOp(..), TerminatorType(..), Inline(..), location)
import Data.Fu... | elegios/datalang | src/Parser.hs | mit | 15,413 | 0 | 19 | 3,464 | 5,185 | 2,676 | 2,509 | -1 | -1 |
module Tictactoe.Def.Base (
playDefender
) where
import Tictactoe.Base
import Tictactoe.HTTPHelper
import Tictactoe.Def.Move
playDefender :: String -> IO ()
playDefender name = playDefender' (TictactoeReq Defender name BencodeList) First
playDefender' :: TictactoeReq -> ExpectedMove Coords -> IO ()
playDefender'... | viktorasl/tictactoe-bot | src/Tictactoe/Def/Base.hs | mit | 815 | 0 | 20 | 238 | 214 | 104 | 110 | 20 | 5 |
{--
- Problem 64
Given a binary tree as the usual Prolog term t(X,L,R) (or nil). As a preparation for drawing the tree, a
layout algorithm is required to determine the position of each node in a rectangular grid. Several layout
methods are conceivable, one of them is shown in the illustration below:
... | sighingnow/Functional-99-Problems | Haskell/64.hs | mit | 3,021 | 0 | 15 | 1,886 | 164 | 84 | 80 | 18 | 1 |
{-# LANGUAGE TupleSections #-}
module OWL2.ParseAS where
import Prelude hiding (lookup)
import OWL2.AS as AS
import Common.AnnoParser (newlineOrEof, commentLine)
import Common.IRI hiding (parseIRI)
import Common.Parsec
import Common.Lexer (getNumber, value, nestCommentOut)
import qualified Common.GlobalAnnotations ... | spechub/Hets | OWL2/ParseAS.hs | gpl-2.0 | 30,904 | 0 | 21 | 5,509 | 7,451 | 3,607 | 3,844 | 654 | 1 |
-- The hacky solution, equivalent to loop + ifs
-- (really we could just find the number of 15s which fit...)
sum [x | x <- [1..999], x `mod` 5 == 0 || x `mod` 3 == 0]
| Grauniad/Haskell-Euler | 001-010/001_Multiples_of_3_and_5.hs | gpl-2.0 | 168 | 0 | 12 | 38 | 53 | 29 | 24 | -1 | -1 |
--
-- Copyright (c) 2012-2013 Bonelli Nicola <bonelli@antifork.org>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later versio... | YelaSeamless/cgrep | src/CGrep/Filter.hs | gpl-2.0 | 9,766 | 0 | 19 | 3,048 | 3,339 | 1,949 | 1,390 | 135 | 6 |
{-
Panda Diffie-Hellman Key Exchange
Copyright (C) 2015 Graham John Pegg
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) a... | toish/panda | src/Cmd/MainOpts.hs | gpl-3.0 | 1,380 | 8 | 13 | 309 | 158 | 95 | 63 | 17 | 0 |
{-
Copyright (C) 2009 Ivan Lazar Miljenovic <Ivan.Miljenovic@gmail.com>
This file is part of SourceGraph.
SourceGraph is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your ... | Baranowski/SourceGraph | CabalInfo.hs | gpl-3.0 | 3,461 | 0 | 13 | 939 | 581 | 309 | 272 | 44 | 1 |
-- Copyright (c) 2015, Sven Thiele <sthiele78@gmail.com>
-- This file is part of hasple.
-- hasple is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any l... | sthiele/hasple | hasple.hs | gpl-3.0 | 1,862 | 0 | 18 | 439 | 398 | 199 | 199 | 37 | 3 |
--
-- This module describes monad for interactive REPL and some basic
-- functions.
--
-- Copyright © 2015–2017 Mark Karpov
--
-- ALGA is free software: you can redistribute it and/or modify it under the
-- terms of the GNU General Public License as published by the Free Software
-- Foundation, either version 3 of the ... | mrkkrp/alga | src/Alga/Interaction/Base.hs | gpl-3.0 | 2,816 | 0 | 14 | 629 | 495 | 287 | 208 | 55 | 2 |
-- * Top
{- GHC version 7.8.3
Direct translation of the table formatting example of
From "Designing and Implementing Combinator Languages"
AFP'98
by Swierstra, S. D. and Azero Alocer, P. R. and Saraiava, J.
Note that the algorithm requires the table to have
the same number of columns in every row.
Use -fcontext-stack... | balez/ag-a-la-carte | Language/Grammars/AGalacarte/Examples/TableFormatting.hs | gpl-3.0 | 18,907 | 0 | 17 | 4,370 | 4,986 | 2,660 | 2,326 | -1 | -1 |
{- |
Module : Data.Grib.Raw.KeysIteratorSpec
Copyright : (c) Mattias Jakobsson 2015
License : GPL-3
Maintainer : mjakob422@gmail.com
Stability : unstable
Portability : portable
Unit and regression tests for Data.Grib.Raw.KeysIterator.
-}
module Data.Grib.Raw.KeysIteratorSpec ( main, spec ) where
impor... | mjakob/hgrib | test/Data/Grib/Raw/KeysIteratorSpec.hs | gpl-3.0 | 2,539 | 0 | 18 | 526 | 530 | 268 | 262 | 41 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module Main where
import Control.Applicative
import Control.Monad
import Control.Monad.Catch
import Control.Monad.IO.Class
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Media.FFMpeg
import qualified Data.Map as M
import System.Directory
import System.Environment
import Syste... | CLowcay/hs-ffmpeg-examples | src/dranger_tuts/01.hs | gpl-3.0 | 3,123 | 147 | 24 | 668 | 1,044 | 553 | 491 | 94 | 3 |
-- | Re-export Mintette functionality
module RSCoin.Mintette
(
module Exports
) where
import RSCoin.Mintette.Acidic as Exports
import RSCoin.Mintette.AcidState as Exports
import RSCoin.Mintette.Env as Exports
import RSCoin.Mintette.Error as E... | input-output-hk/rscoin-haskell | src/RSCoin/Mintette.hs | gpl-3.0 | 435 | 0 | 4 | 138 | 61 | 45 | 16 | 9 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/CatalogTemplates/TemplateVersions/Create.hs | mpl-2.0 | 6,660 | 0 | 17 | 1,393 | 789 | 463 | 326 | 125 | 1 |
module MissingElement where
getMissingElement :: [Int] -> Int
getMissingElement xs = 45 - sum xs
| ice1000/OI-codes | codewars/101-200/return-the-missing-number.hs | agpl-3.0 | 98 | 0 | 6 | 16 | 31 | 17 | 14 | 3 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.