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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
import Primes
answer = last $ takeWhile (<1000000) $ scanl1 (*) primes
| arekfu/project_euler | p0069/p0069.hs | mit | 72 | 0 | 8 | 13 | 31 | 17 | 14 | 2 | 1 |
module P024Spec where
import qualified P024 as P
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "solveBasic" $ do
it "与えられた数値でできるN番目の順列 - 1" $
P.solveBasic [0] 1 `shouldBe` 0
it "与えられた数値でできるN番目の順列 - 2" $
map (P.solveBasic [1, 2]) [1..2] `shouldBe` [12, 21]
... | yyotti/euler_haskell | test/P024Spec.hs | mit | 1,709 | 0 | 15 | 349 | 696 | 387 | 309 | 37 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
-- | Tor error types, inspired by System.IO.Error
module Network.Anonymous.Tor.Error where
import Data.Typeable (Typeable)
import Control.Monad.IO.Class
import Control.Exception (throwIO)
import Control.Exception.Base (Exception)
-- | Error type used
type TorError = TorExcept... | solatis/haskell-network-anonymous-tor | src/Network/Anonymous/Tor/Error.hs | mit | 1,869 | 0 | 8 | 350 | 265 | 160 | 105 | 35 | 1 |
-- ghci
-- :load C:\Users\Thomas\Documents\GitHub\haskell.practice\PE\Problem0026.hs
-- :r
-- :set +s for times
--http://www.computing.surrey.ac.uk/personal/ext/R.Knott/Fractions/FractionsCalc.html
--http://www.computing.surrey.ac.uk/personal/ext/R.Knott/Fractions/fractions.html#section2.2
--If λ is the smallest powe... | Sobieck00/practice | pe/nonvisualstudio/haskell/OldWork/Implementation/Problem0026.hs | mit | 1,720 | 46 | 14 | 349 | 431 | 226 | 205 | 36 | 1 |
module Main where
import Game.Internal
import Test.Tasty
import qualified Test.Tasty.HUnit as HU
import qualified Test.Tasty.QuickCheck as QC
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [unitTests, props]
unitTests :: TestTree
unitTests = testGroup "Unit Tests"
[ HU.testCas... | amar47shah/NICTA-TicTacToe | test/Spec.hs | mit | 2,360 | 0 | 13 | 428 | 766 | 401 | 365 | 59 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
module PostgREST.PgStructure where
import Control.Applicative
import Control.Monad (join)
import... | pap/postgrest | src/PostgREST/PgStructure.hs | mit | 10,207 | 0 | 15 | 3,250 | 1,384 | 763 | 621 | 77 | 2 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.MediaList
(item, item_, itemUnsafe, itemUnchecked, deleteMedium,
appendMedium, setMediaText, getMediaText... | ghcjs/jsaddle-dom | src/JSDOM/Generated/MediaList.hs | mit | 3,843 | 0 | 14 | 615 | 944 | 534 | 410 | -1 | -1 |
module ParameterizedEntity.Schema
( module ParameterizedEntity.Schema
, module ParameterizedEntity.Schema.Virus
) where
import qualified Database.Orville.PostgreSQL as O
import ParameterizedEntity.Schema.Virus
schema :: O.SchemaDefinition
schema = [O.Table virusTable]
| flipstone/orville | orville-postgresql/test/ParameterizedEntity/Schema.hs | mit | 278 | 0 | 7 | 33 | 56 | 36 | 20 | 7 | 1 |
module Test.Hspec.Core.Formatters.V2Spec (spec) where
import Prelude ()
import Helper
import qualified Control.Exception as E
import qualified Test.Hspec.Core.Spec as H
import qualified Test.Hspec.Core.Spec as Spec
import qualified Test.Hspec.Core.Runner as H
import Test.Hspec.Core.Forma... | hspec/hspec | hspec-core/test/Test/Hspec/Core/Formatters/V2Spec.hs | mit | 11,398 | 0 | 26 | 3,686 | 2,835 | 1,394 | 1,441 | 257 | 1 |
-- Helpers/tests/SortingSpec.hs
import Test.Hspec
import Data.List
import Helpers.Sorting
main :: IO()
main = hspec $ do
describe "Quicksort" $ do
it "Should sort a list of Ints" $ do
quicksort [4,1,3,2] `shouldBe` [1,2,3,4]
it "Should sort a list of chars" $ do
quicksort [... | Sgoettschkes/learning | haskell/ProjectEuler/Helpers/tests/SortingSpec.hs | mit | 545 | 0 | 16 | 156 | 188 | 100 | 88 | 14 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Bot.Slack
( SlackMessage (..)
, SlackPostInfo (..)
, SlackPostData (..)
, SlackConfig (..)
, postToSlack
, sendSlackMessage
) where
import Control.Monad
import Control.Monad.Catch
import Control.Mo... | uecmma/LTSHaskell-slack-bot | src/Bot/Slack.hs | mit | 1,939 | 0 | 15 | 472 | 534 | 292 | 242 | -1 | -1 |
{-# LANGUAGE PackageImports #-}
import "swaggy-jenkins" Application (develMain)
import Prelude (IO)
main :: IO ()
main = develMain
| cliffano/swaggy-jenkins | clients/haskell-yesod/generated/app/devel.hs | mit | 132 | 0 | 6 | 19 | 34 | 20 | 14 | 5 | 1 |
module CommandList (commands) where
import Command.Attach
import Command.Categories
import Command.Envelope
import Command.Help
import Command.Init
import Command.Migrate
import Command.Pull
import Command.Rule
import Command.Summary
import Command.Transfer
import CommandType
commands :: [Command]
commands = [ Comma... | jpotterm/manila-hs | src/CommandList.hs | cc0-1.0 | 3,513 | 0 | 7 | 1,359 | 394 | 255 | 139 | 57 | 1 |
{- | Module : $Header$
- Description : Implementation of logic formula parser
- Copyright : (c) Georgel Calin & Lutz Schroeder, DFKI Lab Bremen
- License : GPLv2 or higher, see LICENSE.txt
- Maintainer : g.calin@jacobs-university.de
- Stability : provisional
- Portability : portable
-
- Prov... | nevrenato/Hets_Fork | GMP/versioning/gmp-coloss-0.0.2/GMP/Parser.hs | gpl-2.0 | 7,478 | 0 | 25 | 3,642 | 1,712 | 770 | 942 | 163 | 5 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
import Control.SessionTypes
import Control.SessionTypes.Visualize
import Data.Proxy (Proxy (..))
-- This test requires visual verification.
-- Run the following to generate a diagram:
-- > stack build
-- > stack exec test-visualizer -- -o output.svg -w 600 -h... | Ferdinand-vW/sessiontypes | test/Test/Visualize/Main.hs | gpl-3.0 | 487 | 0 | 18 | 86 | 118 | 67 | 51 | 8 | 1 |
{-# LANGUAGE BangPatterns #-}
module Main where
-- | Ïîäêëþ÷åíèå ìîäóëåé ðàáîòû ñî ñïèñêàìè (Data.List) è ñ ìîíàäàìè (Control.Monad).
-- Ìîäóëè ïîäêëþ÷àþòñÿ ïîä èìåíàìè L è M ñîîòâåòñòâåííî.
-- Èç ìîäóëÿ Control.Monad áåðåòñÿ òîëüêî ôóíêöèÿ guard.
import qualified Data.List as L
import qualified Control.M... | graninas/Haskell-Algorithms | Tests/FailureProbability/FailureProbability.hs | gpl-3.0 | 6,073 | 0 | 15 | 1,501 | 1,205 | 706 | 499 | 87 | 2 |
module PPA.Lang.While.Util (Block (..), init, final, blocks, blockMap, labels, fv, fvA, fvB, flow, aExp, aExpA, aExpB) where
import Prelude hiding (init)
import qualified Data.Set as Set
import qualified Data.Map.Strict as Map
import qualified Data.Maybe as Maybe
import PPA.Lang.While.Internal hiding (aExp)
data Bl... | Isweet/ppa | src/PPA/Lang/While/Util.hs | gpl-3.0 | 4,727 | 0 | 15 | 1,296 | 2,352 | 1,216 | 1,136 | 102 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-}
{-|
This module defines the main 'Application' type,
as well as the associated monad for manipulating it.
-}
module Blog.Core
( module Xport
, AppState(..)
, App
, runApp
, execAppAction
, appBlobStore
, appUsers
, appPosts
... | aslatter/blog | Blog/Core.hs | gpl-3.0 | 3,538 | 0 | 14 | 700 | 859 | 491 | 368 | 82 | 1 |
-- given two numbers
-- find primes in that range
p39 :: Int -> Int -> [Int]
p39 a b = takeWhile (<=b) . dropWhile (<a) $ primes where
primes = sieve [2..] where
sieve (x:xs) = x : sieve [ z | z <- xs, mod z x /= 0 ]
| yalpul/CENG242 | H99/31-41/p39.hs | gpl-3.0 | 244 | 0 | 14 | 79 | 112 | 59 | 53 | 4 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE TemplateHaskell #-}
module Infsabot.Strategy.Random.Logic (
complexity, cRandom,
getDeltas, applyDeltas, constantToParameter, simplify, complicate,
getPartition
) where
im... | kavigupta/Infsabot | Infsabot/Strategy/Random/Logic.hs | gpl-3.0 | 3,527 | 0 | 13 | 948 | 874 | 470 | 404 | 63 | 2 |
-- Copyright 2013 Gushcha Anton
-- This file is part of PowerCom.
--
-- PowerCom 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) any later... | NCrashed/Kaissa | source/Data/WeightedGraph.hs | gpl-3.0 | 2,882 | 0 | 14 | 581 | 727 | 393 | 334 | 33 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Layers/Create.hs | mpl-2.0 | 2,895 | 0 | 13 | 676 | 387 | 232 | 155 | 59 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.AndroidMana... | brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs | mpl-2.0 | 282,686 | 0 | 93 | 66,397 | 47,842 | 27,641 | 20,201 | 5,532 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-adexchange-buyer/gen/Network/Google/Resource/AdExchangeBuyer/PretargetingConfig/Insert.hs | mpl-2.0 | 3,536 | 0 | 13 | 740 | 402 | 240 | 162 | 63 | 1 |
--
-- Copyright 2017-2018 Azad Bolour
-- Licensed under GNU Affero General Public License v3.0 -
-- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md
--
module BoardGame.Server.Domain.HopelessBlanksSpec where
import Test.Hspec
import qualified Data.Set as Set
import qualified Bolour.Language.Domain.W... | azadbolour/boardgame | haskell-server/test/BoardGame/Server/Domain/HopelessBlanksSpec.hs | agpl-3.0 | 2,208 | 0 | 14 | 353 | 559 | 317 | 242 | 47 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
-- |
-- Module : BitTorrent
-- Copyright : (c) Alexandru Scvortov 2009
-- License : LGPL (see LICENSE file)
-- Maintainer : scvalex@gmail.com
--
-- This module centralizes the functions. As a rule of thumb, this
-- should be the only module that you need to import ... | scvalex/ltorrent | BitTorrent.hs | lgpl-3.0 | 2,714 | 0 | 16 | 598 | 496 | 302 | 194 | 53 | 2 |
module Themes (myTheme, myButtonedTheme, Theme (..)) where
import XMonad.Layout.Decoration(Theme(..), Decoration, DefaultShrinker)
import XMonad.Layout.ImageButtonDecoration
import XMonad.Util.Image
import qualified Colors as C
myButtonedTheme = defaultThemeWithImageButtons {
fontName = "xft:RobotoCondensed:size=... | Balletie/.xmonad | lib/Themes.hs | unlicense | 3,091 | 0 | 9 | 894 | 1,752 | 1,146 | 606 | 80 | 1 |
{-|
This package provides basic types used for the Bitcoin networking protocol
together with Data.Serialize instances for efficiently serializing and
de-serializing them. More information on the bitcoin protocol is available
here: <http://en.bitcoin.it/wiki/Protocol_specification>
-}
module Network.Haskoin.Netw... | xenog/haskoin | src/Network/Haskoin/Network.hs | unlicense | 507 | 0 | 4 | 96 | 41 | 31 | 10 | 5 | 0 |
{-|
-}
module Trace (
Ray(
Ray
, rayPoint
, rayVector
, rayMinParam
, rayMaxParam
)
, rayAt
, rayParamIsValid
, Intersection(
Intersection
, isectP
, isectN
, isectUV
, isectRay
, isectRayParam
, isectRayEpsilon
)
, Traceable(
Tr... | lancelet/approxier | src/lib/Trace.hs | apache-2.0 | 3,314 | 0 | 10 | 742 | 601 | 357 | 244 | 74 | 1 |
-- http://www.codewars.com/kata/52756e5ad454534f220001ef
module LongestCommonSubsequence where
import Data.List
import Data.Ord
lcs :: String -> String -> String
lcs x y = maximumBy (comparing length) (subsequences x `intersect` subsequences y) | Bodigrim/katas | src/haskell/4-Longest-Common-Subsequence.hs | bsd-2-clause | 246 | 0 | 8 | 29 | 64 | 35 | 29 | 5 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-----------------------------------------------------------------------------
-- |
-- Module : Web.Pagure.Lens
-- Copyright : (C) 2015 Ricky Elrod
-- License : BSD2 (see LICENSE... | fedora-infra/pagure-haskell | src/Web/Pagure/Lens.hs | bsd-2-clause | 1,161 | 0 | 6 | 133 | 148 | 81 | 67 | 21 | 0 |
{-# LANGUAGE TupleSections, OverloadedStrings, DoAndIfThenElse,TemplateHaskell #-}
module Handler.Home where
import Import
import Yesod.Auth
import Handler.Widget
import Handler.Form
import Handler.Utils(requireAuthId')
import Data.FileEmbed
import Data.Text.Encoding (decodeUtf8)
import Data.List (find)
import quali... | hirokai/PaperServer | Handler/Home.hs | bsd-2-clause | 2,772 | 0 | 16 | 515 | 718 | 369 | 349 | 67 | 4 |
{--
Copyright (c) 2014-2020, Clockwork Dev Studio
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions a... | clockworkdevstudio/Idlewild-Lang | Common.hs | bsd-2-clause | 6,107 | 0 | 15 | 1,425 | 986 | 588 | 398 | 122 | 2 |
--------------------------------------------------------------------------------
-- | Some internal utility functions
module Firefly.Internal
( fromBool
, toBool
) where
--------------------------------------------------------------------------------
import Foreign.C.Types (CInt)
-------------... | jaspervdj/firefly | src/Firefly/Internal.hs | bsd-3-clause | 619 | 0 | 5 | 80 | 75 | 47 | 28 | 11 | 1 |
module Y2015.Day14 (answer1, answer2) where
import Data.List (sort, group, maximumBy)
import Data.Ord (comparing)
answer1 :: IO ()
answer1 = print $ maximum $ map (distanceRun inputTime) reindeers
answer2 :: IO ()
answer2 =
let winners = concatMap winnersAtRound [1 .. inputTime]
points = map length $ gr... | geekingfrog/advent-of-code | src/Y2015/Day14.hs | bsd-3-clause | 1,264 | 0 | 13 | 357 | 486 | 259 | 227 | 38 | 1 |
module Lexer
where
import Text.ParserCombinators.Parsec.Number
import Text.Parsec hiding (tokens, token)
import Data.Foldable (msum)
import Data.Char
type Lexer a = Parsec String () a
data TokenPos = TokenPos {getToken :: Token, getposition :: SourcePos}
data Token = Identifier String
| CapIdentifier Stri... | kwibus/myLang | src/Lexer.hs | bsd-3-clause | 2,648 | 0 | 10 | 702 | 836 | 436 | 400 | 80 | 2 |
module Sort where
import Data.List hiding (null)
import Prelude hiding (null)
-- selection sort
ssort :: Ord a => [a] -> [a]
ssort = unfoldr phi
where
phi [] = Nothing
phi xs = let r@(y, ys) = (minimum xs, xs \\ [y]) in Just r -- select
data Tree a = Null | Fork (Tree a, a, Tree a) deriving (Show, Eq)
fol... | cutsea110/aop | src/Sort.hs | bsd-3-clause | 687 | 0 | 13 | 178 | 397 | 222 | 175 | 21 | 2 |
module Sexy.Functions (module X) where
import Sexy.Functions.List as X
import Sexy.Functions.Maybe as X
import Sexy.Functions.Either as X
import Sexy.Functions.Bool as X
| DanBurton/sexy | src/Sexy/Functions.hs | bsd-3-clause | 171 | 0 | 4 | 22 | 44 | 32 | 12 | 5 | 0 |
-- This demo shows how to authenticate users using OAuth and how to
-- reuse the access tokens.
-- It used the OAuth out of band (OOB) mode and can be used as a starting
-- point to write an application that does not to have a web view.
--
-- Make sure to set the environment variables XING_CONSUMER_KEY and
-- XING_CONS... | JanAhrens/xing-api-haskell | demos/cli-demo.hs | bsd-3-clause | 2,981 | 0 | 15 | 506 | 768 | 402 | 366 | 70 | 2 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
-- | Miscellaneous functions used throughout the compiler.
module Fay.Compiler.Misc where
import Fay.Compiler.Prelude
import ... | fpco/fay | src/Fay/Compiler/Misc.hs | bsd-3-clause | 11,328 | 0 | 17 | 2,561 | 3,313 | 1,690 | 1,623 | 196 | 5 |
module Paths_gpipe_test (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a... | Teaspot-Studio/gpipe-test | .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Paths_gpipe_test.hs | bsd-3-clause | 1,654 | 0 | 10 | 177 | 362 | 206 | 156 | 28 | 1 |
{-# LANGUAGE AutoDeriveTypeable #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Version
-- Copyright : (c) The University of Glasgow 2004
-- License : BSD-style (see the file libraries/... | jstolarek/ghc | libraries/base/Data/Version.hs | bsd-3-clause | 5,139 | 0 | 11 | 1,150 | 448 | 270 | 178 | 33 | 1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE PatternGuards #-}
module Narradar.Constraints.RPO where
import Prelude hiding ((>))
import qualified Prelude
import Control.DeepSeq
import Control.Exception(assert)
import... | pepeiborra/narradar | src/Narradar/Constraints/RPO.hs | bsd-3-clause | 10,478 | 6 | 19 | 3,467 | 3,795 | 1,925 | 1,870 | 206 | 6 |
main :: IO ()
main = do
putStrLn . show $ sum . map (\n -> n^n) $ [1..1000] | bgwines/project-euler | src/solved/problem48.hs | bsd-3-clause | 77 | 0 | 12 | 20 | 55 | 28 | 27 | 3 | 1 |
{-# LANGUAGE RecordWildCards #-}
module Report(
reportText,
reportHTML
) where
import Data.List.Extra
import Data.Tree
import Data.Char
import Data.Hashable
import qualified Data.Set as Set
import Numeric.Extra
import Util
import Type
presort :: [Tree Val] -> [Tree Val]
presort =
sortOn (negate . ti... | ndmitchell/profiterole | src/Report.hs | bsd-3-clause | 2,048 | 0 | 16 | 524 | 827 | 433 | 394 | 49 | 4 |
{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables, GADTs, TypeFamilies, MultiParamTypeClasses #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#elif __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Trustworthy #-}
#endif
#if __GLASGOW_HASKELL__ >= 703
{-# OPTIONS_GHC -fprof-auto #-}
#endif
#if __GLASGOW_HASKELL__ < 701
... | hvr/hoopl | src/Compiler/Hoopl/Dataflow.hs | bsd-3-clause | 34,467 | 34 | 22 | 10,558 | 9,719 | 5,053 | 4,666 | 447 | 14 |
{-# LANGUAGE OverloadedStrings #-}
module Migrate
( run
) where
import Control.Exception
import Control.Monad
import qualified Data.Text as T
import Database.Persist.Sqlite
import System.Directory (doesDirectoryExist)
import qualified Config
import... | fujimura/spot | src/Migrate.hs | bsd-3-clause | 690 | 0 | 11 | 179 | 149 | 80 | 69 | 18 | 1 |
{-# language GADTs #-}
{-# language TypeOperators #-}
{-# language PatternSynonyms #-}
{-# language ViewPatterns #-}
{-# language FlexibleContexts #-}
{-# language ScopedTypeVariables #-}
module Feldspar.Software.Optimize where
import Feldspar.Representation
import Feldspar.Software.... | markus-git/co-feldspar | src/Feldspar/Software/Optimize.hs | bsd-3-clause | 11,670 | 0 | 23 | 2,642 | 4,260 | 2,100 | 2,160 | 186 | 9 |
{-# LANGUAGE ViewPatterns, PatternGuards, TupleSections, RecordWildCards, BangPatterns, ScopedTypeVariables #-}
module Input.Cabal(Cabal(..), parseCabalTarball) where
import Data.List.Extra
import System.FilePath
import Control.Applicative
import Control.DeepSeq
import Control.Exception
import System.IO.Extra
import ... | wolftune/hoogle | src/Input/Cabal.hs | bsd-3-clause | 5,040 | 0 | 18 | 1,242 | 1,599 | 871 | 728 | 75 | 3 |
-- http://adventofcode.com/2016/day/15
module Day_15 where
import Data.List.Split
import Data.Bifunctor
type Position = Int
type Positions = Int
type Disc = (Position, Positions)
main :: IO ()
main = do
fileContents <- readFile "inputs/Day_15_input.txt"
print ("Part 1", part 1 fileContents) -- 148737
print ("... | MaxwellBo/Advent_Of_Code_2016 | Day_15.hs | bsd-3-clause | 949 | 0 | 14 | 235 | 388 | 219 | 169 | 26 | 2 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Ivory.Language.Module where
import Ivory.Language.Area (IvoryArea)
import Ivory.Language.MemArea (MemArea(..),ConstMemArea(..))
import Ivory.Language.Proc (... | Hodapp87/ivory | ivory/src/Ivory/Language/Module.hs | bsd-3-clause | 4,364 | 0 | 18 | 810 | 1,308 | 705 | 603 | 82 | 2 |
module TesteGhcPT where
class Foo a b where
foo :: a -> b -> Int
instance Foo Int a
instance Foo a b => Foo [a] b
g y = let
h :: c -> Int
h x = foo y x
in h y
| rodrigogribeiro/mptc | src/Libs/Tests/TesteGhcPT.hs | bsd-3-clause | 220 | 0 | 9 | 106 | 97 | 47 | 50 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, ExtendedDefaultRules #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes, StandaloneDeriving, TemplateHaskell #-}
{-# LANGUAGE TypeOperators, ViewPatterns #-}
{-# OPTIONS_GHC -fwarn-unuse... | konn/expandth | lib/ASTUtil.hs | bsd-3-clause | 2,790 | 0 | 13 | 818 | 837 | 464 | 373 | 49 | 1 |
import Database.HDBC
import Database.HDBC.Sqlite3
import ScottyCA
import Web.Scotty
import Data.ByteString.Lazy (ByteString, append, empty, pack, length, toStrict, fromStrict)
import qualified Data.ByteString.Lazy.Char8 as L
import Data.Binary
import System.IO
import Crypto.Cipher.AES
import Control.Monad.Trans
impo... | armoredsoftware/protocol | tpm/mainline/privacyCA/testsql.hs | bsd-3-clause | 1,685 | 8 | 14 | 309 | 447 | 232 | 215 | 45 | 2 |
{- | Module : $Header$
- Description : Implementation of logic instance K
- Copyright : (c) Daniel Hausmann & Georgel Calin & Lutz Schroeder, DFKI Lab Bremen,
- Rob Myers & Dirk Pattinson, Department of Computing, ICL
- License : GPLv2 or higher, see LICENSE.txt
- Maintainer : hausma... | nevrenato/Hets_Fork | GMP/versioning/gmp-coloss-0.0.3/GMP/Logics/K.hs | gpl-2.0 | 2,198 | 0 | 18 | 511 | 441 | 240 | 201 | -1 | -1 |
{-|
hledger - a ledger-compatible accounting tool.
Copyright (c) 2007-2011 Simon Michael <simon@joyful.com>
Released under GPL version 3 or later.
hledger is a partial haskell clone of John Wiegley's "ledger". It
generates ledger-compatible register & balance reports from a plain text
journal, and demonstrates a func... | simonmichael/hledger | hledger/Hledger/Cli/Main.hs | gpl-3.0 | 12,387 | 1 | 21 | 3,192 | 2,364 | 1,240 | 1,124 | 154 | 8 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="ar-SA">
<title>Replacer | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref lo... | veggiespam/zap-extensions | addOns/replacer/src/main/javahelp/org/zaproxy/zap/extension/replacer/resources/help_ar_SA/helpset_ar_SA.hs | apache-2.0 | 970 | 80 | 66 | 159 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE QuasiQuotes
, DeriveDataTypeable
, ScopedTypeVariables
, MultiParamTypeClasses
, FlexibleInstances
, UndecidableInstances
#-}
{-
** *********************************************************************
* ... | GaloisInc/pads-haskell | Language/Pads/BaseTypes.hs | bsd-3-clause | 5,149 | 0 | 14 | 1,278 | 1,422 | 798 | 624 | 81 | 4 |
import Database.HaskellDB.HSQL.SQLite
import RunTests
opts = [("filepath","hsql-sqlite-test.db"),("mode","rw")]
main = dbTestMain $ Conn {
dbLabel = "hsql-sqlite",
dbConn = connect driver opts
}
| m4dc4p/haskelldb | test/test-hsql-sqlite.hs | bsd-3-clause | 277 | 0 | 8 | 104 | 62 | 38 | 24 | 6 | 1 |
{-# LANGUAGE DeriveFunctor #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Tar
-- Copyright : (c) 2007 Bjorn Bringert,
-- 2008 Andrea Vezzosi,
-- 2008-2009 D... | randen/cabal | cabal-install/Distribution/Client/Tar.hs | bsd-3-clause | 33,979 | 0 | 19 | 9,362 | 7,564 | 4,020 | 3,544 | 623 | 15 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-rds/gen/Network/AWS/RDS/AuthorizeDBSecurityGroupIngress.hs | mpl-2.0 | 7,600 | 0 | 9 | 1,377 | 718 | 436 | 282 | 86 | 1 |
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Keymap.Vim.Eval
-- License : GPL-2
-- Maintainer : yi-devel@googlegroups.com
-- Stability : experimental
-- Portability : portable
--
-- This module doesn't contains actual eval, see
-- 'Yi.Keymap.Vim.vimEval' comment.
module Yi.Keymap.Vim.E... | Hi-Angel/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Eval.hs | gpl-2.0 | 661 | 0 | 8 | 112 | 103 | 67 | 36 | 7 | 1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="pt-BR">
<title>Complemento de Navegação Forçada</title>
<maps>
<homeID>top</homeID>
<ma... | thc202/zap-extensions | addOns/bruteforce/src/main/javahelp/org/zaproxy/zap/extension/bruteforce/resources/help_pt_BR/helpset_pt_BR.hs | apache-2.0 | 986 | 77 | 66 | 158 | 420 | 212 | 208 | -1 | -1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="sq-AL">
<title>Token Generator | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<map... | kingthorin/zap-extensions | addOns/tokengen/src/main/javahelp/org/zaproxy/zap/extension/tokengen/resources/help_sq_AL/helpset_sq_AL.hs | apache-2.0 | 976 | 78 | 66 | 159 | 413 | 209 | 204 | -1 | -1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="da-DK">
<title>Active Scan Rules | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<m... | thc202/zap-extensions | addOns/ascanrules/src/main/javahelp/org/zaproxy/zap/extension/ascanrules/resources/help_da_DK/helpset_da_DK.hs | apache-2.0 | 976 | 78 | 66 | 160 | 418 | 211 | 207 | -1 | -1 |
{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-}
--
-- (c) The University of Glasgow 2002-2006
--
-- Serialized values
module Serialized (
-- * Main Serialized data type
Serialized,
seqSerialized,
-- * Going into and out of 'Serialized'
toSerialized, fromSerialized,
-- * Handy s... | acowley/ghc | compiler/utils/Serialized.hs | bsd-3-clause | 7,185 | 0 | 18 | 1,750 | 2,305 | 1,224 | 1,081 | 110 | 5 |
module Typed.Reference
( module M
, pattern Tref
, pattern Tderef
, pattern Tassign
, pattern Tloc
, pattern Kref
, Term(ReferenceTerm)
, EvalTerm(RefEvalTerm)
) where
import Control.Monad
import Control.Monad.Catch
import qualified Data.Map as M
import qualified Data.Tree as T
import Preliminaries
i... | myuon/typed | tapl/src/Typed/Reference.hs | mit | 4,088 | 0 | 21 | 1,105 | 1,968 | 974 | 994 | -1 | -1 |
{-# LANGUAGE BangPatterns #-}
module Codec.Picture.Ari.Header.ICI where
-- ICI stands for Image Content Information
import Data.Binary
import Data.Binary.Get
import Data.Binary.IEEE754
import Control.Applicative
import Control.Monad
import qualified Data.ByteString as BS
import Codec.Picture.Ari.Types
--
-- TODO : c... | cpichard/aritools | src/Codec/Picture/Ari/Header/ICI.hs | mit | 8,694 | 0 | 44 | 3,803 | 963 | 526 | 437 | 178 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.MediaStreamTrack
(js_getSources, getSources, js_getConstraints, getConstraints,
js_states, states, js_getCapabilities, getCapabilities,
js_applyConstraints, applyConstraints, js_clone, clone... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/MediaStreamTrack.hs | mit | 10,110 | 102 | 11 | 1,644 | 1,975 | 1,072 | 903 | 159 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RecordWildCards #-}
module Goolosh.Game.Interpret where
import Prelude(($),Num(..),Floating(..),Float,(.))
import Control.Monad
import Data.Maybe
import qualified Data.Conduit as C
import qualified Data.Sequence as S
import Data.Sequence((|>))
import Control.Monad.Trans... | LeviSchuck/Goolosh | src/Goolosh/Game/Interpret.hs | mit | 4,473 | 0 | 19 | 1,805 | 940 | 528 | 412 | 100 | 2 |
{-|
Module: Capnp.Gen.Capnp
Description: Generated modules for the schema that ship with Cap'N Proto
The modules under 'Capnp.Gen.Capnp' are generated code for the schema files that
ship with the Cap'N Proto reference implementation.
-}
module Capnp.Gen.Capnp () where
| zenhack/haskell-capnp | lib/Capnp/Gen/Capnp.hs | mit | 270 | 0 | 3 | 39 | 11 | 8 | 3 | 1 | 0 |
-- Mathematics/Fundamentals/Minimum Draws
module Main where
import qualified HackerRank.Mathematics.MinimumDraws as M
main :: IO ()
main = M.main
| 4e6/sandbox | haskell/hackerrank/MinimumDraws.hs | mit | 149 | 0 | 6 | 21 | 31 | 20 | 11 | 4 | 1 |
{-# LANGUAGE DeriveGeneric #-}
-- TODO This probably should not be a part of Character.
module D20.Internal.Character.Action where
import GHC.Generics
import D20.Character
import D20.Internal.Item
data ActionTime
= AttackAction
| MoveAction
| FullRoundAction
| FreeAction
deriving (Show,Eq,Ord,Generic)
--... | elkorn/d20 | src/D20/Internal/Character/Action.hs | mit | 1,192 | 0 | 8 | 267 | 164 | 110 | 54 | 27 | 0 |
{-
1. Faça uma função que receba o nome de um aluno e uma lista com suas três notas. A função deve então devolver uma tupla com o nome do aluno e a média das notas. Exemplo:
> aprovado "Joao" [80, 60, 100]
("Joao", 80)
-}
e4 :: String -> [Float] -> (String, Float)
e4 nome notas = (nome, sum notas / 3)
{-
al_m... | hugonasciutti/Exercises | Haskell/Exercises/pratica3.hs | mit | 2,648 | 0 | 10 | 626 | 512 | 293 | 219 | 24 | 1 |
-- (2 балла)
module Eval
( Eval, runEval
, Error, Store
, update, getVar
) where
import qualified Data.Map as M
import Data.List
import Control.Monad
import Control.Applicative
import Expr
type Error = String
type Store = M.Map String Value
newtype Eval a = Eval { runEval :: Store -> (Maybe a, [Erro... | SergeyKrivohatskiy/fp_haskell | hw10/Interpreter/Eval.hs | mit | 1,336 | 0 | 9 | 257 | 340 | 178 | 162 | 30 | 1 |
module MicroKanren.ExampleMonadic where
import Control.Monad
import Control.Monad.Trans.State
import MicroKanren
import MicroKanren.Plain (LVar(..), CanUnify)
import MicroKanren.Cons
aANDb ∷ Logic (LVar Int)
aANDb = do
a ← fresh
b ← fresh
a === LVal 7
mplus (b === LVal 5)
... | Oregu/featherweight | ExampleM.hs | mit | 1,584 | 0 | 13 | 527 | 580 | 295 | 285 | -1 | -1 |
module Main
( main
) where
import Haste
main :: IO ()
main = alert "hello bayhac"
| alephcloud/bayhac2014 | contrib/hello-bayhac.hs | mit | 84 | 0 | 6 | 19 | 30 | 17 | 13 | 5 | 1 |
module Oodle.SymbolTable where
import Oodle.Error
import Oodle.ParseTree
import Oodle.Token
type SymbolTable = [Symbol]
data Symbol = Symbol {
symbol :: String,
decl :: Declaration
}
deriving (Show, Eq)
data Declaration
-- parent variables methods inherited methods
= ClassDecl Tok... | lseelenbinder/oodle-compiler | Oodle/SymbolTable.hs | mit | 4,024 | 0 | 16 | 951 | 1,411 | 739 | 672 | 88 | 7 |
import Data.List
truncateFromLeft :: Int -> [Int]
truncateFromLeft = map read . init . tail . tails . show
truncateFromRight :: Int -> [Int]
truncateFromRight = map (read . reverse) . init . tail . tails . reverse . show
isPrime :: Int -> Bool
isPrime n | n == 1 = False
| n < 4 = True
| n `mod` 2... | jwtouron/haskell-play | ProjectEuler/Problem37.hs | mit | 906 | 0 | 13 | 282 | 404 | 204 | 200 | 25 | 1 |
{-# OPTIONS -fexpose-all-unfoldings #-}
{-# OPTIONS -funbox-strict-fields #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Game.Graphics.Texture
( Texture (), Sampling (..), Alpha (..), TextureError (..)... | caryoscelus/graphics | src/Game/Graphics/Texture.hs | mit | 7,691 | 0 | 23 | 1,992 | 2,021 | 1,029 | 992 | 130 | 13 |
module TeXWriter (writeTeX) where
import Ast
import Data.List (intercalate)
cmd_ :: String -> String
cmd_ = ("\\" ++)
cmd :: String -> String
cmd = cmd_ . (++ " ")
cmdargs :: String -> [String] -> String
cmdargs c = concat . (cmd_ c:) . map (\a -> "{" ++ a ++ "}")
writeConst :: Constant -> String
writeConst (Consta... | Kerl13/AsciiMath | src/lib/TeXWriter.hs | mit | 8,686 | 0 | 18 | 3,210 | 2,311 | 1,126 | 1,185 | 181 | 97 |
module Shared where
numDigits :: (Integral a, Integral b) => a -> b
numDigits n = ceiling $ log (fromIntegral $ n+1) / log 10
digitalSum :: (Integral a) => a -> a
digitalSum = sum . map (`mod` 10) . takeWhile (> 0) . iterate (`div` 10)
concNumbers :: Integral a => a -> a -> a
concNumbers x y = y + x * (10 ^ (numDigi... | edwardwas/euler | shared/src/Shared.hs | mit | 689 | 0 | 16 | 164 | 381 | 204 | 177 | 15 | 1 |
module Lib.Fresh
( Fresh, new
, next
) where
import Control.Applicative ((<$>))
import Data.IORef
newtype Fresh a = Fresh (IORef a)
{-# INLINE new #-}
new :: a -> IO (Fresh a)
new x = Fresh <$> newIORef x
{-# INLINE next #-}
next :: Enum a => Fresh a -> IO a
next (Fresh ref) = atomicModifyIORef' ref $ \old ->... | nadavshemer/buildsome | src/Lib/Fresh.hs | gpl-2.0 | 337 | 0 | 8 | 75 | 141 | 77 | 64 | 12 | 1 |
{- |
Module : $Header$
Description : compute the theory of a node
Copyright : (c) Christian Maeder and DFKI GmbH 2009
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : non-portable(Logic)
compute the theory of a node
-}
module ... | nevrenato/Hets_Fork | Static/ComputeTheory.hs | gpl-2.0 | 7,365 | 0 | 25 | 1,858 | 2,244 | 1,163 | 1,081 | 153 | 6 |
module Promise (Symbol, Constraint, Term, Promise(Thunk, Result)) where
import Data
import JSON
import Store
import Text.JSON
type Symbol = Address Promise
type Constraint = (Symbol, Promise)
type Term = Either Symbol Data
data Promise
= Thunk String [Term]
| Result Data
instance JSON Promise where
showJSON ... | lachrist/kusasa-hs | promise.hs | gpl-2.0 | 780 | 0 | 11 | 216 | 256 | 137 | 119 | 21 | 0 |
-- #hide
-----------------------------------------------------------------------------
-- |
-- Module : Graphics.UI.GLUT.Raw.Tokens
-- Copyright : (c) Sven Panne 2009
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- Stability : stable
-- Portability : portable... | ducis/haAni | hs/common/Graphics/UI/GLUT/Raw/Tokens.hs | gpl-2.0 | 11,973 | 0 | 5 | 1,465 | 2,020 | 1,220 | 800 | 399 | 1 |
data Val = I Integer | S String | L [Val] | F Func | E Expr | ST State | Nil deriving (Show)
data Proto = FP [String] Expr deriving (Show)
data Func = NF NativeFunc | MF Proto State
data Expr = Var String | Value Val | Call Expr [Expr] deriving (Show)
type State = [(String, Val)]
type NativeFunc = (State, Expr) ->... | FiveEye/xlang | proto/proto0.hs | gpl-2.0 | 3,514 | 50 | 21 | 807 | 2,319 | 1,255 | 1,064 | 81 | 4 |
{-# LANGUAGE TemplateHaskell #-}
module Code.Huffman.LR where
-- $Id$
import Autolib.ToDoc
import Autolib.Reader
import Code.Type
import Data.Typeable
data LR = L | R
deriving ( Eq, Ord, Enum, Bounded, Typeable )
$(derives [makeReader, makeToDoc] [''LR])
data Ord a => Letter a = Letter
{ weight :... | florianpilz/autotool | src/Code/Huffman/LR.hs | gpl-2.0 | 468 | 7 | 10 | 117 | 146 | 87 | 59 | 13 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module WebParsing.ParsingHelp
(CoursePart,
(-:),
(~:),
emptyCourse,
preProcess,
replaceAll,
tagContains,
dropBetween,
dropBetweenAll,
dropAround,
isCourse,
isCancelled,
lowerTag,
notCancelled,
parseDescription,
parseCorequ... | arkon/courseography | hs/WebParsing/ParsingHelp.hs | gpl-3.0 | 8,717 | 0 | 16 | 1,767 | 2,414 | 1,317 | 1,097 | 144 | 2 |
module HLinear.FramedModule.Definition
where
import HLinear.Utility.Prelude
import HLinear.Matrix.Definition ( Matrix(..) )
import HLinear.Hook.EchelonForm ( EchelonForm(..) )
-- we work with echelon forms of row matrices
data FramedModule a =
FramedModuleBasis (EchelonForm a) (Vector Int)
| FramedModuleDual ... | martinra/hlinear | src/HLinear/FramedModule/Definition.hs | gpl-3.0 | 370 | 0 | 8 | 56 | 94 | 57 | 37 | 8 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
module Ampersand.Output.ToJSON.JSONutils
(writeJSONFile, JSON(..), ToJSON(..)
, module Ampersand.Basics
, module Ampersand.Classes
, module Ampersand.Core.ParseTree
, module Ampersand.Core.ShowA... | AmpersandTarski/ampersand | src/Ampersand/Output/ToJSON/JSONutils.hs | gpl-3.0 | 3,024 | 0 | 15 | 690 | 598 | 350 | 248 | 55 | 2 |
{-# LANGUAGE OverloadedStrings #-}
-- Copyright (C) 2011 John Millikin <jmillikin@gmail.com>
--
-- 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
-- any lat... | jmillikin/anansi-hscolour | lib/Anansi/HsColour.hs | gpl-3.0 | 1,411 | 8 | 7 | 249 | 136 | 93 | 43 | 14 | 1 |
module ValueMatrix
where
import Data.Array.IArray
import Data.Array.Base as A ((!))
import Data.Monoid
import Data.Tuple
import Vector
import Control.DeepSeq.Generics
type VMKey = (Int,Int)
type VMat a = Array VMKey a
data ValueMatrix a = VM
{ vmat :: !(VMat a) } -- deriving Eq
-- TODO: newtype
instance NFData... | KiNaudiz/bachelor | CN/ValueMatrix.hs | gpl-3.0 | 1,859 | 0 | 11 | 570 | 800 | 418 | 382 | 50 | 1 |
module Y2015.R1A.A where
import Data.List
import Data.Maybe
import Data.String.Utils
solve :: Problem -> Solution
parse :: [String] -> [Problem]
data Solution = Solution Int Int
deriving (Eq)
instance Show Solution
where show (Solution y z) = show y ++ " " ++ show z
data Problem = Problem { xs :: ... | joranvar/GoogleCodeJam | Y2015/R1A/A.hs | gpl-3.0 | 687 | 0 | 13 | 190 | 284 | 148 | 136 | 20 | 1 |
import System.Exit
import System.Environment
main = getArgs >>= exitWith . ExitFailure . read . head
| YoshikuniJujo/hake_haskell | examples/exitTest/exitWith.hs | gpl-3.0 | 102 | 0 | 8 | 16 | 32 | 17 | 15 | 3 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Reservations/Delete.hs | mpl-2.0 | 4,570 | 0 | 17 | 1,052 | 552 | 330 | 222 | 85 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-drive/gen/Network/Google/Resource/Drive/Comments/Delete.hs | mpl-2.0 | 2,937 | 0 | 14 | 685 | 388 | 233 | 155 | 60 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/GetVaultNotifications.hs | mpl-2.0 | 5,802 | 0 | 9 | 1,070 | 539 | 333 | 206 | 68 | 1 |
import System.Environment
import System.Directory
import System.IO
import Data.List
import Control.Exception
dispatch :: String -> [String] -> IO ()
dispatch "add" = add
dispatch "view" = view
dispatch "remove" = remove
main = do
(command:argList) <- getArgs
dispatch command argList
add :: [String] -> IO ()
add ... | alexliew/learn_you_a_haskell | code/todo2.hs | unlicense | 1,352 | 0 | 15 | 327 | 459 | 227 | 232 | 40 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types #-}
module Lib where
import qualified Data.ByteString as B (ByteString)
import qualified Data.ByteString.Char8 as BC (putStrLn)
import qualified Pipes as P (Consumer', MonadIO, Producer',
... | haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/streaming/pipes/src/Lib.hs | unlicense | 4,500 | 0 | 17 | 1,412 | 1,146 | 610 | 536 | 83 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.