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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{- | Graphics.Gnewplot.Style contain constructors that wrap plottable
things to modify their display style in individual panels. Example:
@
import Graphics.Gnewplot.Instances
import Graphics.Gnewplot.Exec
someData :: [(Double,Double)]
somedata = [(0.0, 1.0),(0.1, 2.0),(0.2, 1.4),(0.3, 1.7),(0.4, 1.0),
(0.... | glutamate/gnewplot | Graphics/Gnewplot/Style.hs | bsd-3-clause | 14,562 | 0 | 22 | 3,996 | 5,206 | 2,686 | 2,520 | 250 | 6 |
{-
(c) Bartosz Nitka, Facebook, 2015
UniqDFM: Specialised deterministic finite maps, for things with @Uniques@.
Basically, the things need to be in class @Uniquable@, and we use the
@getUnique@ method to grab their @Uniques@.
This is very similar to @UniqFM@, the major difference being that the order of
folding is n... | vikraman/ghc | compiler/utils/UniqDFM.hs | bsd-3-clause | 13,800 | 0 | 13 | 3,079 | 3,333 | 1,745 | 1,588 | 182 | 3 |
module MasterSlave where
import Control.Monad
import Control.Distributed.Process
import Control.Distributed.Process.Closure
import PrimeFactors
slave :: (ProcessId, Integer) -> Process ()
slave (pid, n) = send pid (numPrimeFactors n)
remotable ['slave]
-- | Wait for n integers and sum them all up
sumIntegers :: Int... | haskell-distributed/distributed-process-demos | src/MasterSlave/MasterSlave.hs | bsd-3-clause | 1,462 | 0 | 21 | 379 | 532 | 274 | 258 | -1 | -1 |
module Types where
import Data.Map
import Data.Word
--------------------------------------------------------------------------------
data Colour = Colour { red :: Word8,
green :: Word8,
blue :: Word8 }
deriving (Show)
data Config = Config { borderColour ... | Ornedan/dom3conquestmaptool | Types.hs | bsd-3-clause | 518 | 0 | 9 | 206 | 99 | 60 | 39 | 12 | 0 |
{-# OPTIONS_GHC -Wall #-}
module Elm.Internal.Paths where
import Build.Utils (getDataFile)
import System.IO.Unsafe (unsafePerformIO)
-- |Name of directory for all of a project's dependencies.
dependencyDirectory :: FilePath
dependencyDirectory = "elm_dependencies"
-- |Name of the dependency file, specifying dependen... | deadfoxygrandpa/Elm | compiler/Elm/Internal/Paths.hs | bsd-3-clause | 749 | 0 | 6 | 101 | 90 | 56 | 34 | 14 | 1 |
{-|
Module : Manifest.SQLite
Description : An SQLite-backed Manifest.
copyright : (c) Alexander Vieth, 2015
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Flexible... | avieth/Manifest | Manifest/SQLite.hs | bsd-3-clause | 8,338 | 5 | 17 | 2,405 | 1,537 | 831 | 706 | 163 | 1 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE DataKinds, FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstanc... | yesodweb/persistent | persistent-postgresql/test/ArrayAggTest.hs | mit | 1,901 | 0 | 21 | 462 | 466 | 248 | 218 | 44 | 1 |
main = 3 'div' 4
| roberth/uu-helium | test/thompson/Thompson01.hs | gpl-3.0 | 17 | 0 | 5 | 5 | 12 | 6 | 6 | -1 | -1 |
{-# LANGUAGE TypeOperators, BangPatterns, Rank2Types, PatternGuards
, ExistentialQuantification, ScopedTypeVariables, GADTs
#-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- temp
{-# OPTIONS_GHC -Wall #-}
----------------------------------------------------------------------
-- |
-- Module : Data.P... | sseefried/shady-gen | src/Data/PolyStableMemo.hs | agpl-3.0 | 4,275 | 0 | 20 | 1,255 | 615 | 336 | 279 | 34 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Model.Markdown.Diff where
import Prelude
import Data.Algorithm.Diff
import Yesod.Markdown
import Database.Persist.TH
import Data.Maybe
import qualified Data.Text as T
data DiffInfo = S | B | F deriving (Eq, Ord, Read, Show)
data MarkdownDiff = MarkdownDiff [(D... | chreekat/snowdrift | Model/Markdown/Diff.hs | agpl-3.0 | 1,031 | 0 | 10 | 188 | 379 | 207 | 172 | -1 | -1 |
{- Each project can generate invitation codes to give users special roles such as Moderator or Team Member or Admin.
Invitation.hs is where invited users go to actually redeem invitations they receive. -}
module Handler.Invitation where
import Import
import qualified Data.Text as T
-- import Model.Role
getInvitati... | chreekat/snowdrift | Handler/Invitation.hs | agpl-3.0 | 1,794 | 0 | 23 | 525 | 429 | 204 | 225 | -1 | -1 |
module HplAssets.DTMC (
transformDtmc,
emptyDtmc
) where
import BasicTypes
import HplAssets.DTMC.Types
import FeatureModel.Types
import Data.Generics
import Data.List
import Data.Maybe
import Data.FDTMC (FeatureSelection,
resolve,
append,
compose)
emptyDtm... | rbonifacio/hephaestus-pl | src/meta-hephaestus/HplAssets/DTMC.hs | lgpl-3.0 | 2,099 | 0 | 13 | 441 | 643 | 341 | 302 | 35 | 1 |
{-
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... | monky-hs/monky | Monky/Outputs/Guess.hs | lgpl-3.0 | 4,499 | 8 | 20 | 943 | 1,139 | 607 | 532 | 96 | 3 |
module Network.Haskoin.Test.Util where
import qualified Data.ByteString as BS
import Data.Time.Clock (UTCTime (..))
import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
import Data.Word (Word32)
import Test.QuickCheck
-- | Arbitrary strict ByteString
arb... | xenog/haskoin | src/Network/Haskoin/Test/Util.hs | unlicense | 1,089 | 0 | 8 | 276 | 244 | 138 | 106 | 19 | 1 |
{- misc utility functions
-
- Copyright 2010-2011 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
module Utility.Misc where
import Utility.FileSystemEncoding
import Utility.Monad
import System.IO
import Control.Monad
import Foreign
import Data.Char... | sjfloat/propellor | src/Utility/Misc.hs | bsd-2-clause | 4,549 | 6 | 12 | 901 | 1,188 | 621 | 567 | 72 | 3 |
-- |
-- Module : Crypto.Hash.Blake2s
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- Module containing the binding functions to work with the
-- Blake2s cryptographic hash.
--
{-# LANGUAGE ForeignFunctionInterface #-}
{-# ... | vincenthz/cryptonite | Crypto/Hash/Blake2s.hs | bsd-3-clause | 2,727 | 0 | 11 | 679 | 531 | 289 | 242 | 52 | 0 |
{-# LANGUAGE CPP, NamedFieldPuns, NondecreasingIndentation #-}
{-# OPTIONS_GHC -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
-----------------------------------------------------------------------------
--
-- GHC Driver
--
-- (c) The University of Glasgow 2005
--
------------------------------... | seereason/ghcjs | src/Compiler/DriverPipeline.hs | mit | 102,016 | 0 | 31 | 35,638 | 16,564 | 8,368 | 8,196 | 1,443 | 45 |
module GameEngine.Data.BSP where
import Data.Word
import Data.Vector (Vector)
import Data.Vect hiding (Vector)
import Data.ByteString
{-
Information:
http://graphics.stanford.edu/~kekoa/q3/
http://www.mralligator.com/q3/
-}
data Model
= Model
{ mdMins :: !Vec3
, mdMaxs :: !Vec3
, ... | csabahruska/quake3 | game-engine/GameEngine/Data/BSP.hs | bsd-3-clause | 3,111 | 0 | 11 | 1,078 | 791 | 448 | 343 | 254 | 0 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Machine.Pipe
-- Copyright : (C) 2015 Yorick Laupa, Gabriel Gonzalez
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Yorick Laupa <y... | fumieval/machines | src/Data/Machine/Pipe.hs | bsd-3-clause | 4,970 | 0 | 15 | 1,307 | 1,442 | 762 | 680 | 76 | 4 |
module System.Info.ShortPathName
( getShortPathName
) where
import System.Win32.Info (getShortPathName)
| juhp/stack | src/windows/System/Info/ShortPathName.hs | bsd-3-clause | 109 | 0 | 5 | 14 | 23 | 15 | 8 | 3 | 0 |
{-
******************************************************************************
* H M T C *
* *
* Module: ScopeLevel *
*... | jbracker/supermonad-plugin | examples/monad/hmtc/original/ScopeLevel.hs | bsd-3-clause | 1,896 | 0 | 6 | 729 | 174 | 111 | 63 | 21 | 1 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleInstances #-}
{-
Copyright (C) 2015 Martin Linnemann <theCodingMarlin@googlemail.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 ... | janschulz/pandoc | src/Text/Pandoc/Readers/Odt/Arrows/State.hs | gpl-2.0 | 10,991 | 2 | 14 | 3,489 | 2,939 | 1,582 | 1,357 | -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="sr-CS">
<title>Form Handler | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref... | kingthorin/zap-extensions | addOns/formhandler/src/main/javahelp/org/zaproxy/zap/extension/formhandler/resources/help_sr_CS/helpset_sr_CS.hs | apache-2.0 | 973 | 78 | 66 | 159 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE TupleSections, UnboxedTuples #-}
module Main where
a :: Bool -> (Int, Bool)
a = ( , True)
b :: Int -> Bool -> (Int, Bool)
b = (1, )
c :: a -> (a, Bool)
c = (True || False, )
d :: Bool -> (#Int, Bool#)
d = (# , True#)
e :: Int -> Bool -> (#Int, Bool#)
e = (#1, #)
f :: a -> (#a, Bool#)
f = (#True || Fa... | hvr/jhc | regress/tests/1_typecheck/4_fail/ghc/tcfail206.hs | mit | 345 | 8 | 9 | 88 | 186 | 111 | 75 | 15 | 1 |
--
-- Adapted from the program "infer", believed to have been originally
-- authored by Philip Wadler, and used in the nofib benchmark suite
-- since at least the late 90s.
--
module StateX (StateX, returnSX, eachSX, thenSX, toSX, putSX, getSX, useSX) where
data StateX s a = MkSX (s -> a)
rep (MkSX f) ... | jasonzoladz/parconc-examples | parinfer/StateX.hs | bsd-3-clause | 779 | 0 | 13 | 211 | 351 | 200 | 151 | 10 | 1 |
import qualified Data.Vector as U
main = print . head . U.toList . U.fromList $ replicate 1 (7::Int)
| dolio/vector | old-testsuite/microsuite/from-to.hs | bsd-3-clause | 101 | 0 | 8 | 18 | 45 | 25 | 20 | 2 | 1 |
module WhereIn3 where
f y = g y
where
g x@(Left a) = case x of
(Right b) -> b
(Left a) -> a
| RefactoringTools/HaRe | old/testing/simplifyExpr/WhereIn3_TokOut.hs | bsd-3-clause | 156 | 0 | 11 | 88 | 62 | 32 | 30 | 5 | 2 |
-- !!! ds016 -- case expressions
--
module ShouldCompile where
f x y z =
case ( x ++ x ++ x ++ x ++ x ) of
[] -> []
[a] -> error "2"
[a,b,c] ->
case ( (y,z,y,z) ) of
-- (True, _, False, _) | True == False -> z
-- (True, _, F... | ezyang/ghc | testsuite/tests/deSugar/should_compile/ds016.hs | bsd-3-clause | 409 | 0 | 10 | 199 | 121 | 68 | 53 | 9 | 4 |
-- Copyright (c) 2000 Galois Connections, Inc.
-- All rights reserved. This software is distributed as
-- free software under the license in the file "LICENSE",
-- which is included in the distribution.
module Parse where
import Data.Char
import Text.ParserCombinators.Parsec hiding (token)
import Data
program :: ... | urbanslug/ghc | testsuite/tests/programs/galois_raytrace/Parse.hs | bsd-3-clause | 3,880 | 0 | 21 | 1,220 | 1,264 | 639 | 625 | 89 | 4 |
-- Copyright (c) 2000 Galois Connections, Inc.
-- All rights reserved. This software is distributed as
-- free software under the license in the file "LICENSE",
-- which is included in the distribution.
module Primitives where
rad2deg :: Double -> Double
rad2deg r = r * 180 / pi
deg2rad :: Double -> Double
deg2rad ... | ryantm/ghc | testsuite/tests/programs/galois_raytrace/Primitives.hs | bsd-3-clause | 532 | 0 | 7 | 118 | 154 | 85 | 69 | 13 | 1 |
module ViewTranslation where
import qualified Matrix4f
import qualified Vector3f
import qualified Vector4f
import Vector3f (x, y, z)
translation :: Vector3f.T -> Matrix4f.T
translation p =
let np_x = -(x p)
np_y = -(y p)
np_z = -(z p)
in
Matrix4f.T {
Matrix4f.column_3 = Vector4f.V4 np_x np_y... | io7m/jcamera | com.io7m.jcamera.documentation/src/main/resources/com/io7m/jcamera/documentation/haskell/ViewTranslation.hs | isc | 510 | 0 | 11 | 129 | 176 | 97 | 79 | 15 | 1 |
module WebPage where
import Profile
import Conf
import TokenCSFR
import OAuth
import API
import Lucid
import Protolude
import Control.Lens
import Data.Aeson
import Orphan.UUID
import Network.URL -- t... | mreider/kinda-might-work | src/WebPage.hs | mit | 7,057 | 0 | 23 | 4,287 | 1,105 | 542 | 563 | -1 | -1 |
module Hafer.Data.GenericGraph
( module Hafer.Data.GenericGraph -- TODO: proper interface
) where
import Data.List (find)
-- Data declarations
data Graph v e = MathGraph [Vertex v] [Edge v e]
| ElemSetGraph [GraphElem v e]
deriving (Show, Eq)
data Vertex v = Vertex v
deriving (Show, Eq)
... | ooz/Hafer | src/Hafer/Data/GenericGraph.hs | mit | 3,237 | 0 | 16 | 1,469 | 996 | 516 | 480 | 68 | 3 |
britishDenominations = [ 1, 2, 5, 10, 20, 50, 100, 200 ]
countSplits :: (Integral a) => a -> [a] -> a
countSplits n dens = countSplits' n remaining
where remaining = takeWhile (<=n) dens
countSplits' n [] | n>0 = 0
countSplits' 0 _ = 1
countSplits' _ [x] = 1
countSplits' n rem = sum $ map (\d -> countSplits (n-d)... | arekfu/project_euler | p0031/p0031.hs | mit | 392 | 0 | 12 | 80 | 191 | 102 | 89 | 9 | 1 |
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Yesod.Paginator.Pages
(
-- * Type safe @'Natural'@s
-- |
--
-- N.B. @'PageNumber'@ and @'PerPage'@ will currently allow @0@, but it's
-- unclear if that's correct and may not be the case in the future.
--... | pbrisbin/yesod-paginator | src/Yesod/Paginator/Pages.hs | mit | 4,769 | 0 | 13 | 1,070 | 1,233 | 675 | 558 | 90 | 2 |
module SqlTypes where
import qualified CsvTypes as Mcsv
import Data.Text
import Database.Persist.TH (mkPersist, mkMigrate, persistLowerCase,
share, sqlSettings)
share [mkPersist sqlSettings, mkMigrate "migrateTables"] [persistLowerCase|
District
sid Int
name ... | rdlester/meap-analysis | Src/SqlTypes.hs | mit | 852 | 0 | 7 | 274 | 62 | 39 | 23 | -1 | -1 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.SVGAnimatedAngle (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.SVGAnimatedAngle
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/SVGAnimatedAngle.hs | mit | 361 | 0 | 5 | 33 | 33 | 26 | 7 | 4 | 0 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.CharacterData
(js_substringData, substringData, js_appendData, appendData,
js_insertData, insertData, js_deleteData, deleteData,
js_replaceData, replaceData, js_setData, setData, js_getData,... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/CharacterData.hs | mit | 5,262 | 70 | 13 | 955 | 1,257 | 690 | 567 | 93 | 1 |
-- | Interpreter for the DSL to generate `PromptScript`'s.
module Interp where
import AST
import Control.Monad
import Data.Foldable (foldlM)
import Data.Map.Strict (Map, filterWithKey, findWithDefault,
mapAccum, mapAccumWithKey)
import qual... | rwoll-hmc/project | src/Interp.hs | mit | 9,241 | 0 | 23 | 2,941 | 2,357 | 1,229 | 1,128 | 140 | 3 |
module GCC where
import Data.Maybe
import Data.List
import Data.Char
trim :: String -> String
trim = f . f
where f = reverse . dropWhile isSpace
type Int32 = Int
type Addr = Int
data AddrOrLabel = AbsAddr Addr | RefAddr String
instance Show AddrOrLabel where
show (AbsAddr n) = show n
show (RefAddr label) = l... | jchl/icfp2014 | src/GCC.hs | mit | 5,271 | 0 | 17 | 1,556 | 2,040 | 1,038 | 1,002 | 143 | 9 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Y2017.M11.D10.Exercise where
{--
So we've got keywords and recommended article sets as files we're reading from.
El-great-o.
Now, let's create a scheme and upload these data to our data store.
--}
import Data.Map (Map)
import Database.PostgreSQL.Simple
import ... | geophf/1HaskellADay | exercises/HAD/Y2017/M11/D10/Exercise.hs | mit | 6,179 | 0 | 12 | 1,133 | 693 | 417 | 276 | 59 | 1 |
{-# LANGUAGE TemplateHaskell #-}
import Luck.Template
import Test.QuickCheck
gen :: Gen (Maybe [Bool])
gen = $(mkGenQ defFlags{_fileName="examples/Combination.luck",_maxUnroll=14}) tProxy1
main = sample $ (fmap . fmap . fmap) fromEnum gen
| QuickChick/Luck | luck/examples-template/combination.hs | mit | 241 | 0 | 10 | 31 | 83 | 45 | 38 | 6 | 1 |
module Language.F2.Eval (eval, getInt, getBool, getTuple, applyValue, getValue) where
import Language.F2.DataType
import Control.Monad.Error
import Control.Monad.State
getInt :: Value -> Either String Integer
getInt v = do
v' <- getValue v
case v' of
VInt x -> return x
_ -> throwError "exec error : type m... | kagamilove0707/F2 | src/Language/F2/Eval.hs | mit | 2,117 | 0 | 18 | 585 | 1,051 | 501 | 550 | 83 | 4 |
module Hasql.Postgres.Options where
import BasePrelude
import Options.Applicative
import qualified Hasql.Postgres as HP
-- |
-- Given a prefix for long names produce a parser of 'HP.Settings'.
settings :: Maybe String -> Parser HP.Settings
settings prefix =
HP.ParamSettings <$> host <*> port <*> user <*> password ... | nikita-volkov/hasql-postgres-options | library/Hasql/Postgres/Options.hs | mit | 1,193 | 0 | 13 | 379 | 311 | 154 | 157 | 39 | 1 |
{- |
Module : $Header$
Copyright : Heng Jiang, Uni Bremen 2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
OWL 2 signature and sentences
-}
module OWL2.Sign where
import OWL2.AS
import qualified Data.Set as Set
i... | nevrenato/Hets_Fork | OWL2/Sign.hs | gpl-2.0 | 3,910 | 0 | 12 | 1,131 | 1,011 | 543 | 468 | 76 | 1 |
{-|
A ledger-compatible @balance@ command, with additional support for
multi-column reports.
Here is a description/specification for the balance command. See also
"Hledger.Reports" -> \"Balance reports\".
/Basic balance report/
With no reporting interval (@--monthly@ etc.), hledger's balance
command emulates ledg... | kmels/hledger | hledger/Hledger/Cli/Balance.hs | gpl-3.0 | 21,273 | 0 | 26 | 5,547 | 3,712 | 1,982 | 1,730 | 226 | 8 |
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE OverloadedStrings #-}
module Game.Osu.OszLoader.OsuParser.DifficultySpec (spec) where
import Data.Attoparsec.Text
import Data.Text hiding (map, filter, null)
import Game.Osu.OszLoader.OsuParser.Difficulty
import Game.Osu.OszLoader.Types
import Test.Hspec
import Test.QuickChe... | Fuuzetsu/osz-loader | test/Game/Osu/OszLoader/OsuParser/DifficultySpec.hs | gpl-3.0 | 1,745 | 0 | 18 | 430 | 408 | 216 | 192 | 42 | 1 |
module Parser (Line(..), LineType(..), Expr(..), NumType(..), getOp, parseFile,
regNum, symbolString) where
import Register (lookupRegisterName)
import Util (readBin)
import Control.Arrow ((>>>))
import Control.Applicative ((<$>), (<*>))
import Data.Bits ((.|.), (.&.), shiftL, shiftR, xor)
import Data... | adamsmasher/EMA | Parser.hs | gpl-3.0 | 7,254 | 0 | 13 | 2,400 | 2,384 | 1,218 | 1,166 | 187 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-directconnect/gen/Network/AWS/DirectConnect/DescribeVirtualInterfaces.hs | mpl-2.0 | 5,291 | 0 | 10 | 957 | 573 | 346 | 227 | 67 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Versions/SetLatest.hs | mpl-2.0 | 5,456 | 0 | 16 | 1,169 | 705 | 413 | 292 | 109 | 1 |
{- ORMOLU_DISABLE -}
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca)
-- Copyright 2014 2015 2016, Julia Longtin (julial@turinglace.com)
-- Copyright 2015 2016, Mike MacHenry (mike.machenry@gmail.com)
-- Released under the GNU AGPLV3+, see LICENSE
module Graphics.Implicit.ObjectUtil.GetBox3 (getB... | colah/ImplicitCAD | Graphics/Implicit/ObjectUtil/GetBox3.hs | agpl-3.0 | 6,583 | 5 | 22 | 1,999 | 2,279 | 1,239 | 1,040 | 111 | 8 |
-- using || && and or
-- || && 与 and or的定义是不一样的,要注意
usingandorinfixr = True || (False && True)
usingandor = or [False, and [True, False]]
-----------------------------------------------
firstOrEmpty :: [[Char]] -> [Char]
firstOrEmpty lst = if not (null lst) then head lst else "empty"
(+++) :: [a] -> [a] -> [a]
lst1 +... | wangyixiang/beginninghaskell | chapter2/src/Chapter2/SimpleFunctions.hs | unlicense | 1,605 | 20 | 13 | 370 | 792 | 420 | 372 | 39 | 4 |
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE JavaScriptFFI #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-
Copyright 2020 The CodeWorld Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compl... | google/codeworld | funblocks-client/src/Blocks/CodeGen.hs | apache-2.0 | 6,050 | 0 | 18 | 1,690 | 2,054 | 966 | 1,088 | 187 | 3 |
module Reverse where
bang :: String -> String
bang = (++ "!")
why :: String -> Char
why = (!! 4)
awesome = dropWhile (/= 'a')
thirdLetter = (!! 2)
letterIndex :: Int -> Char
letterIndex = ("Curry is awesome!" !!)
-- You’re expected
-- only to slice and dice this particular string with take and drop.
-- Curry is a... | prt2121/haskell-practice | hb-chap03/src/Main.hs | apache-2.0 | 1,842 | 0 | 11 | 400 | 208 | 134 | 74 | 18 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Persistence.Book where
import Data.Text (Text, unpack)
import qualified Database.PostgreSQL.Simple as PG
import Model.Book
getBookByShortUID :: Text -> PG.Connection -> IO (Maybe Book)
getBookByShortUID shortuid conn = do
results <- PG.query conn
... | DataStewardshipPortal/ds-wizard | DSServer/app/Persistence/Book.hs | apache-2.0 | 659 | 0 | 11 | 249 | 135 | 72 | 63 | 14 | 2 |
module Network.Eureka.Version.Cabal (
fromVersions
, fromVersion
, fromString
, showVersion
, versionInRangeP
) where
import Data.Maybe (listToMaybe)
import qualified Data.Version as DV (Version, Version (Version),
parseVersion, showVersion)
import Network.Eureka.Version.Types (Version, Predicate)
impo... | SumAll/haskell-eureka-semver | src/Network/Eureka/Version/Cabal.hs | apache-2.0 | 847 | 0 | 9 | 145 | 248 | 141 | 107 | 27 | 1 |
-- Copyright 2020 Google LLC
--
-- 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 applicable law or agreed to in ... | google/hrepl | hrepl/tests/FfiUser2.hs | apache-2.0 | 677 | 0 | 6 | 117 | 45 | 31 | 14 | 3 | 1 |
module Bintree where
-- Binary tree
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq)
instance Show a => Show (Tree a) where
show (Leaf a) = show a
show (Branch x y) = "<" ++ show x ++ " | " ++ show y ++ ">"
--
instance Eq Data where
func =
treeFoldr :: (b -> a -> a) -> a -> T... | riccardotommasini/plp16 | haskell/prepared/ESE20181120/Bintree.hs | apache-2.0 | 1,086 | 0 | 10 | 312 | 485 | 245 | 240 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module Test.Delorean.Local.Date where
import Data.Text (Text, pack)
import Delorean.Local
import P
import System.IO
import ... | ambiata/delorean | test/Test/Delorean/Local/Date.hs | bsd-3-clause | 3,566 | 0 | 14 | 652 | 925 | 483 | 442 | 97 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS -Wall #-}
-- |
-- Module : Network.Mail.Client.Gmail
-- License : BSD3
-- Maintainer : Enzo Haussecker
-- Stability : Experimental
-- Portability : Unknown
--
-- A dead simp... | brokendata/smtps-gmail | Network/Mail/Client/Gmail.hs | bsd-3-clause | 24,808 | 0 | 17 | 6,920 | 4,511 | 2,321 | 2,190 | 589 | 449 |
{-# LANGUAGE OverloadedStrings #-}
module CommonMark.Renderer.Html
( def
, renderBlock
, renderDoc
, dummyDoc
, HtmlOptions
) where
import Data.Default
import Data.Monoid ( (<>), mconcat)
import Data.Sequence
import Data.Foldable ( toList )
import Data.Text ( Text )
import Text.Blaze.Html5 ( ... | Jubobs/CommonMark-WIP | src/CommonMark/Renderer/Html.hs | bsd-3-clause | 1,796 | 0 | 13 | 523 | 488 | 268 | 220 | 42 | 4 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
module VCS.Apply where
import Data.Type.Equality hiding (apply)
import VCS.Multirec
import Language.Clojure.Lang
import Language.Common
import Debu... | nazrhom/vcs-clojure | src/VCS/Apply.hs | bsd-3-clause | 2,716 | 0 | 14 | 741 | 1,302 | 633 | 669 | 64 | 3 |
{-# LANGUAGE CPP
, DataKinds
, GADTs
, TypeOperators
, PolyKinds
, FlexibleContexts
, ScopedTypeVariables
, UndecidableInstances
#-}
-- TODO: all the instances here are orphans. To ensure that we don't
-- have issues about orphan i... | zaxtax/hakaru | haskell/Language/Hakaru/Syntax/AST/Eq.hs | bsd-3-clause | 19,170 | 11 | 16 | 6,307 | 7,339 | 3,661 | 3,678 | 430 | 46 |
module Main(main) where
import PolyPaver.Invocation
import Data.Ratio ((%))
main =
defaultMain Problem
{
box = [(0,(409018325532672 % 579004697502343,9015995347763200 % 6369051672525773)),(1,(1 % 2,2 % 1))]
,theorem = thm
}
thm =
Implies (Geq (Var 0) (Over (Over (Lit (1023 ... | michalkonecny/polypaver | examples/old/their_sqrt/their_sqrt_12.hs | bsd-3-clause | 1,210 | 0 | 31 | 217 | 712 | 376 | 336 | 9 | 1 |
{-# LANGUAGE TypeFamilies #-}
import Music.Prelude
import qualified Music.Score as Score
markIf :: (HasColor a, HasPitches' a, Score.Pitch a ~ Pitch) => (Interval -> Bool) -> Score a -> Score a
markIf p = mapIf (\x -> p $ withOrigin c $ x ^?! pitches) mark
where
mark = colorRed
mapIf p f = u... | music-suite/music-preludes | examples/analysis.hs | bsd-3-clause | 850 | 0 | 11 | 202 | 257 | 131 | 126 | 16 | 1 |
-- |This library simplifies the task of securely connecting two
-- servers to each other. It closely mimicks the regular socket API,
-- and adds the concept of identity: each communicating server has an
-- identity, and connections can only be established between two
-- servers who know each other and expect to be comm... | GaloisInc/secure-sockets | Network/Secure.hs | bsd-3-clause | 4,019 | 0 | 5 | 852 | 172 | 146 | 26 | 23 | 0 |
module Main where
import Data.List
import System.Environment
import qualified Semantics
import Tests.Frenetic.Slices.TestCompile
import Tests.Frenetic.Slices.TestEndToEnd
import Tests.Frenetic.Slices.TestSlice
import Tests.Frenetic.Slices.TestVerification
import Tests.Frenetic.Slices.TestVlanAssignment
import Tests.Fr... | frenetic-lang/netcore-1.0 | testsuite/Main.hs | bsd-3-clause | 1,031 | 0 | 11 | 336 | 192 | 111 | 81 | 27 | 3 |
{-# LANGUAGE TypeSynonymInstances #-}
module Types where
import Protolude
type App a = ReaderT AppConfig (ExceptT AppError IO) a
data AppError = LoginError Text
| TagNotFound Text
| TagHasNoText Text
| UsageNotParsable Text
| BalanceNotParsable Text... | section77/datenverbrauch | src/Types.hs | bsd-3-clause | 3,101 | 0 | 10 | 1,150 | 652 | 359 | 293 | 80 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
module Network.Conduits where
import Network
import Util
import Conduit
import Static
import Network.Runners
import Control.Applicative
trainC :: forall m i ls.
( MonadIO m
, Creatable (Network i ls)
)
=> Lear... | jonascarpay/convoluted | src/Network/Conduits.hs | bsd-3-clause | 1,055 | 0 | 17 | 438 | 331 | 168 | 163 | 29 | 2 |
{-# LANGUAGE CPP, OverloadedStrings, DataKinds, GADTs #-}
module Main where
import Language.Hakaru.Pretty.SExpression
import Language.Hakaru.Syntax.AST.Transforms
import Language.Hakaru.Syntax.TypeCheck
import Language.Hakaru.Command
import Language.Hakaru.Summary
#i... | zachsully/hakaru | commands/PrettySExpression.hs | bsd-3-clause | 1,489 | 0 | 14 | 381 | 388 | 210 | 178 | 41 | 2 |
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text.IO as TO
import Text.Parsec
import Data.Cauterize.Parser
import Data.Cauterize.Generators.C
main :: IO ()
main = do
d <- TO.readFile fname
case parse parseCauterize fname d of
Left e -> print e
Right v -> print $ gen v
where
fname = "ex... | sw17ch/Z-ARCHIVED-hscauterize | hscauterize.hs | bsd-3-clause | 331 | 0 | 11 | 70 | 106 | 55 | 51 | 12 | 2 |
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE PolyKinds #-}
module Data.LnFunctor.Coapply where
import Data.LnFunctor
class LnFunctor f => LnCoapply f where
type Unlink f h m k l i j :: Constraint
lcoap :: Unl... | kylcarte/lnfunctors | src/Data/LnFunctor/Coapply.hs | bsd-3-clause | 1,467 | 0 | 11 | 440 | 850 | 450 | 400 | 37 | 1 |
module P025 where
import Data.Maybe (fromJust)
import Data.List (find)
import Fibonacci (fibonacci)
run :: IO ()
run = print (fst found)
where
found = fromJust . find (\(i, f) -> (length . show) f == 1000) . zip [1..] $ fibonacci
| tyehle/euler-haskell | src/P025.hs | bsd-3-clause | 238 | 0 | 16 | 49 | 112 | 62 | 50 | 7 | 1 |
module LibSpec where
import Test.Hspec
import Del.Lib
import Del.Syntax
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "simplifyExp" $ do
let a = Sym "a" mempty mempty
it "checks a+a=2a" $
simplifyExp (Add a a) `shouldBe` (Mul (Num 2.0) a)
it "checks a-a=0" $
simplifyExp (... | ishiy1993/mk-sode1 | test/LibSpec.hs | bsd-3-clause | 681 | 0 | 16 | 180 | 305 | 150 | 155 | 22 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Rumpus.TestScene where
import Rumpus
-- | For profiling (where we can't run code)
-- and for other prototyping.
loadTestScene :: ECSMonad ()
loadTe... | lukexi/rumpus | src/Rumpus/TestScene.hs | bsd-3-clause | 5,408 | 0 | 28 | 1,963 | 1,449 | 738 | 711 | 113 | 1 |
{-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings, ScopedTypeVariables #-}
module Utils.Spoty
(
module Utils.Spoty.Types,
getAlbum, getAlbumTracks,
getArtist, getArtistAlbums, CountryID, getArtistTop, getArtistRelated,
SearchCategory(..),
search, searchArtist, searchAlbum, searchTrack,
getTrack,
getUser,
fetch... | davnils/spoty | src/Utils/Spoty.hs | bsd-3-clause | 5,834 | 11 | 17 | 1,154 | 1,724 | 910 | 814 | -1 | -1 |
module CalculatorKata.Day1Spec (spec) where
import Test.Hspec
import CalculatorKata.Day1 (calculate)
spec :: Spec
spec = do
it "calculates one digit"
(calculate "2" == 2.0)
it "calculates many digits"
(calculate "234" == 234.0)
it "calculates addition"... | Alex-Diez/haskell-tdd-kata | old-katas/test/CalculatorKata/Day1Spec.hs | bsd-3-clause | 602 | 0 | 11 | 202 | 160 | 78 | 82 | 17 | 1 |
-- | Helper functions to make it easy to start messing around
module System.MIDI.Utility
( selectMidiDevice
, selectInputDevice
, selectOutputDevice
)
where
--------------------------------------------------------------------------------
import Data.List
import Control.Monad
import Control.Concurrent
i... | chpatrick/hmidi | System/MIDI/Utility.hs | bsd-3-clause | 2,472 | 0 | 28 | 625 | 620 | 303 | 317 | 57 | 6 |
module Monad(
ServerEnv(..)
, ServerM
, newServerEnv
, runServerM
, runServerMIO
, AuthM(..)
, runAuth
) where
import Control.Monad.Base
import Control.Monad.Catch (MonadCatch, MonadThrow)
import Control.Monad.Except
import Control.Monad.Logger
import Control.Monad.Reader
import Control.Monad.Trans.C... | NCrashed/servant-auth-token | example/persistent/src/Monad.hs | bsd-3-clause | 3,007 | 0 | 13 | 568 | 780 | 420 | 360 | -1 | -1 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, PatternGuards, TypeSynonymInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.Tabbed
-- Copyright : (c) 2007 David Roundy, Andrea Rossato
-- License : BSD-style (see xmonad/LICENS... | eb-gh-cr/XMonadContrib1 | XMonad/Layout/Tabbed.hs | bsd-3-clause | 7,253 | 0 | 17 | 1,724 | 1,591 | 870 | 721 | 89 | 1 |
module LAuREL.Lib (stdlib) where
import Data.Functor
import Data.String.Utils
import LAuREL.Types
import System.Random (getStdRandom, randomR)
o_add :: Lib -> [Expr] -> IO Evaluated
o_add lib [Type (Integer a), Type (Integer b)] =
return $ Evaluated lib $ return $ Type $ Integer $ a + b
o_sub :: Lib -> [Exp... | davbaumgartner/LAuREL | LAuREL/Lib.hs | bsd-3-clause | 4,398 | 77 | 11 | 944 | 1,959 | 1,011 | 948 | 80 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Text.InjectSpec (main, spec) where
import Test.Hspec
import Test.Hspec.Expectations.Contrib
import Text.Inject
import Data.Attoparsec.Text
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "inject" $ do
it "expands... | beni55/inject | test/Text/InjectSpec.hs | mit | 675 | 0 | 16 | 160 | 165 | 84 | 81 | 18 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module TW.Check where
import TW.Ast
import TW.BuiltIn
import Control.Monad.Except
import qualified Data.Map as M
data DefinedType
= DefinedType
{ dt_name :: QualTypeName
, dt_args :: [TypeVar]
} deriving (Show, Eq)
builtInToDefTy :: BuiltIn -> DefinedType
builtInToDefTy... | agrafix/typed-wire | src/TW/Check.hs | mit | 3,511 | 0 | 28 | 1,457 | 985 | 480 | 505 | 86 | 6 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-ecs/gen/Network/AWS/ECS/DeleteService.hs | mpl-2.0 | 4,320 | 0 | 13 | 1,023 | 662 | 392 | 270 | 88 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- | Parse Składnica in the CONLL format and output lemma sentences
-- which can be potentially parsed by the plTAG grammar.
--
-- (The CONLL parser used below is borrowed from the Grzegorz
-- Chrupala's `colada` library)
import qualified Data.Text.Lazy as L
import qualified Data.... | kawu/french-tag | tools/parse-skladnica-conll.hs | bsd-2-clause | 2,436 | 0 | 12 | 515 | 612 | 344 | 268 | 43 | 9 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TupleSections #-}
-- | Names for packages.
module Stack.Types.PackageName
(PackageName
,Pack... | mrkkrp/stack | src/Stack/Types/PackageName.hs | bsd-3-clause | 5,511 | 0 | 14 | 1,276 | 1,221 | 639 | 582 | 124 | 3 |
{-# LANGUAGE DeriveGeneric #-}
module System.Console.GetOpt.Generics.ModifierSpec where
import qualified GHC.Generics
import Generics.SOP
import Test.Hspec
import System.Console.GetOpt.Generics.Modifier
import Util
spec :: Spec
spec = do
describe "insertWith" $ do
it "c... | kosmikus/getopt-generics | test/System/Console/GetOpt/Generics/ModifierSpec.hs | bsd-3-clause | 933 | 0 | 18 | 218 | 248 | 136 | 112 | 30 | 1 |
{- |
Module : $Header$
Copyright : (c) Till Mossakowski, Wiebke Herding, C. Maeder, Uni Bremen 2004
License : GPLv2 or higher, see LICENSE.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : provisional
Portability : portable
Parser for modal logic extension of CASL
-}
module Hybrid.Pars... | mariefarrell/Hets | Hybrid/Parse_AS.hs | gpl-2.0 | 3,268 | 0 | 16 | 960 | 973 | 472 | 501 | 101 | 1 |
-- Refactoring: move myFringe to module D6. This refactoring test the adding of hiding
-- in the import declaration (see module B6), and the adding the import decl and the change
-- of qualifiers.
module C6(Tree(..), SameOrNot(..)) where
data Tree a = Leaf a | Branch (Tree a) (Tree a)
sumTree:: (Num a) => Tree a... | SAdams601/HaRe | old/testing/moveDefBtwMods/C6_TokOut.hs | bsd-3-clause | 577 | 0 | 8 | 137 | 184 | 99 | 85 | 11 | 1 |
{-# LANGUAGE TypeApplications, ScopedTypeVariables, PolyKinds,
TypeFamilies, RankNTypes,
FlexibleContexts #-}
-- tests about visible type application
module Vta1 where
quad :: a -> b -> c -> d -> (a, b, c, d)
quad = (,,,)
silly = quad @_ @Bool @Char @_ 5 True 'a' "Hello"
pairup_nosig x y =... | olsner/ghc | testsuite/tests/typecheck/should_compile/Vta1.hs | bsd-3-clause | 2,038 | 0 | 11 | 511 | 935 | 508 | 427 | 61 | 1 |
module Test where
import Test2 hiding (main)
main = doit
| wxwxwwxxx/ghc | testsuite/tests/driver/T437/Test.hs | bsd-3-clause | 60 | 0 | 5 | 13 | 18 | 12 | 6 | 3 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ConstraintKinds #-}
module Futhark.Representation.SOACS.SOAC
( SOAC(..)
, StreamForm(..)
, typeCheckSOAC
... | ihc/futhark | src/Futhark/Representation/SOACS/SOAC.hs | isc | 27,710 | 24 | 25 | 7,481 | 8,349 | 4,166 | 4,183 | 535 | 6 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.VTTRegionList
(js_item, item, js_getRegionById, getRegionById, js_getLength,
getLength, VTTRegionList, castToVTTRegionList, gTypeVTTRegionList)
where
import Prelude ((.), (==), (>>=), return,... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/VTTRegionList.hs | mit | 2,288 | 22 | 11 | 326 | 582 | 344 | 238 | 37 | 1 |
module Battleship where
import Data.Maybe
import Data.List
import Haste.Random
import DataTypes
{-
Lab Assignment 4
Anna Averianova & Tobias Deekens, 2013
-}
-- Returns the size of a given boat model
sizeOfModel :: Model -> Int
sizeOfModel AircraftCarrier = 5
sizeOfModel Battleship = 4
sizeOfModel Submari... | tdeekens/tda452-code | Lab-4/Battleship.hs | mit | 10,493 | 0 | 17 | 2,781 | 3,479 | 1,912 | 1,567 | 174 | 2 |
import System.Random
import System.Environment
import qualified Data.List as List
import qualified Data.Map as Map
import Control.Monad
import Control.Arrow
import ML.Common
import ML.DecisionTree
import ML.RandomForest
main = do
args <- getArgs
let reader = if (args !! 0 == "f") then reasSamplesClassIsLead e... | Daiver/HRandomForest | main3.hs | mit | 847 | 0 | 13 | 171 | 207 | 109 | 98 | 19 | 2 |
module Utils where
import Data.Char
elemAny :: (Eq a) => [a] -> [a] -> Bool
elemAny l1 l2 = or $ map (\x -> elem x l2) l1
splitInto :: Int -> [a] -> [[a]]
splitInto n list
| length list <= n = [list]
| otherwise = fst split : splitInto n (snd split)
where split = splitAt n list
allDigit :: String -> Bo... | crockeo/ballgame | src/Utils.hs | mit | 416 | 0 | 9 | 102 | 210 | 109 | 101 | 13 | 1 |
module Frequency where
englishLetters =
[ ('e',8269949)
, ('t',6393831)
, ('a',5618362)
, ('i',5174648)
, ('o',5156878)
, ('n',4897495)
, ('s',4548571)
, ('r',4122762)
, ('h',3313317)
, ('l',2859703)
, ('d',2541643)
, ('c',2256826)
, ('u',2084567)
, ('m',1760271)
, ('p',1479766)
, ('f',... | bhamrick/puzzlib | Frequency.hs | mit | 14,337 | 0 | 6 | 4,931 | 6,801 | 4,533 | 2,268 | 758 | 1 |
module Listas
( unittest
, primeiros
, calculaSomaPA
, calculaProdPA
, mapeiaListaPA
) where
primeiros 0 _ = []
primeiros n [] = []
primeiros n (a:x) = a : primeiros (n - 1) x
fact = foldl (*) 1 . enumFromTo 1
-- a0 = 0
calculaSomaPA n razao = sum (map (\x -> razao + ((x - 1) * razao)) (take n [1..]))
-- a0 = 0
m... | tonussi/freezing-dubstep | pratica-10/Listas.hs | mit | 1,801 | 0 | 14 | 400 | 938 | 516 | 422 | 38 | 1 |
import Data.Dates
sumProperDivisors :: Int -> Int
sumProperDivisors n = iter 2 1
where
iter i acc
| isDivisor && (i*i == n) = acc + i
| isDivisor = iter (i+1) (acc + i + n `div` i)
| i*i >= n = acc
| otherwise = iter (i+1) acc
where... | dpieroux/euler | 0/0021.hs | mit | 609 | 0 | 13 | 212 | 239 | 121 | 118 | 14 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module System.Tianbar.Plugin.Socket where
-- Socket connectivity
import Control.Concurrent
import Control.Lens hiding (index)
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.State
import Control.Monad.Trans.Maybe
import qualified Data.ByteString.UTF8 as U
imp... | koterpillar/tianbar | src/System/Tianbar/Plugin/Socket.hs | mit | 2,174 | 0 | 16 | 497 | 626 | 311 | 315 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.