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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-------------------------------------------------------------------------------
A printing shop runs 16 batches (jobs) every week and each batch requires a
sheet of special colour-proofing paper of size A5.
Every Monday morning, the foreman opens a new envelope, containing a large sheet
of the special paper with siz... | dpieroux/euler | 0151.hs | mit | 3,677 | 3 | 13 | 1,023 | 548 | 295 | 253 | 25 | 1 |
module Network.API.Twitter.Shim
( shimToken
) where
import Network.OAuth.Consumer (Token)
import Data.Binary (decode)
import Data.ByteString.Lazy.Char8 (pack)
shimToken :: Token
shimToken = decode $ pack shimStr
shimStr = "\STX\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SYNy7mcOjAr18BvMV5KVKNW0g\NUL\NUL\NUL\NUL\NUL\N... | whittle/twitter-api | Network/API/Twitter/Shim.hs | mit | 975 | 0 | 6 | 44 | 68 | 42 | 26 | 8 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Float.BoundedFloat.FloatProgress
( -- * The FloatProgress Widget
FloatProgress
-- * Constructor
, mk... | gibiansky/IHaskell | ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloat/FloatProgress.hs | mit | 1,855 | 0 | 13 | 407 | 284 | 165 | 119 | 37 | 1 |
module Week4 where
fun1 :: [Integer] -> Integer
fun1 [] = 1
fun1 (x:xs)
| even x = (x - 2) * fun1 xs
| otherwise = fun1 xs
fun1' :: [Integer] -> Integer
fun1' = foldr (\x acc-> acc * (x - 2)) 1 . filter even
fun2 :: Integer -> Integer
fun2 1 = 0
fun2 n
| even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * ... | taylor1791/cis-194-spring | src/Week4.hs | mit | 2,872 | 0 | 11 | 763 | 1,351 | 686 | 665 | 72 | 2 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Betfair.APING.Types.MarketDescription
( Mark... | joe9/betfair-api | src/Betfair/APING/Types/MarketDescription.hs | mit | 1,656 | 0 | 9 | 436 | 278 | 173 | 105 | 38 | 0 |
module Utils.IOFold where
ioFoldl :: (a -> IO b) -> [b] -> [a] -> IO [b]
ioFoldl _ l [] = return l
ioFoldl f l (x:xs) = do
i <- f x
if not $ null xs
then ioFoldl f (i:l) xs
else return (i:l)
-- Esta implementação tem de ser revista
ioFoldr :: (a -> IO b) -> [b] -> [a] -> IO [b]
ioFoldr f l xs ... | Miguel-Fontes/hs-file-watcher | src/Utils/IOFold.hs | mit | 754 | 0 | 10 | 228 | 418 | 212 | 206 | 23 | 2 |
module Counting (
Color(..),
territories,
territoryFor
) where
import Data.Array.IArray ((!), Array)
import qualified Data.Array.IArray as Array
import Data.Maybe (catMaybes, isNothing, mapMaybe)
import Data.Set (Set)
import qualified Data.Set as Set
-- | A board is an effici... | exercism/xhaskell | exercises/practice/go-counting/.meta/examples/success-standard/src/Counting.hs | mit | 4,592 | 0 | 16 | 1,263 | 1,225 | 670 | 555 | 73 | 3 |
-- | This module implements the ancient Scytale transposition cipher (for more
-- info, see <https://en.wikipedia.org/wiki/Scytale Wikipedia>.
module Text.Cipher.Scytale where
import Text.Cipher.Types
-- | Given a perimeter for the scytale, transpose a text from
-- any character set.
--
-- >>> scytale 5 "i like train... | kmein/ciphers | src/Text/Cipher/Scytale.hs | mit | 938 | 0 | 12 | 211 | 231 | 121 | 110 | 14 | 1 |
-- Test the fast buffer implementation
module Tests.Buffer where
import Yi.Buffer
import Yi.FastBuffer
import Data.Unique
import Data.Char
import Data.List
import Data.Maybe
import System.Directory
import System.IO.Unsafe
import Control.Monad
import qualified Control.Exception
import Control.Concurrent
import Tes... | codemac/yi-editor | attic/testsuite/Tests/Buffer.hs | gpl-2.0 | 13,394 | 0 | 13 | 5,596 | 181 | 98 | 83 | -1 | -1 |
-- | The 'CombatState' module contains code that is stateful in the sense
-- that it applies various modifiers to the player and the monster, such
-- as checking whether the player has enough light to see the monster and
-- modifying evasion and accuracy accordingly.
module CombatState(CombatState(),
... | kryft/fsil | CombatState.hs | gpl-2.0 | 7,558 | 0 | 17 | 1,613 | 2,104 | 1,097 | 1,007 | 147 | 3 |
--------------------------------------------------------------------------------
-- This file is part of diplomarbeit ("Diplomarbeit Johannes Weiß"). --
-- --
-- diplomarbeit is free software: you can redistribute it and/or modify ... | weissi/diplomarbeit | programs/StaticConfiguration.hs | gpl-3.0 | 2,957 | 0 | 8 | 789 | 301 | 176 | 125 | 25 | 1 |
-- Copyright (C) 2014 Google Inc. All rights reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License"); you may not
-- use this file except in compliance with the License. You may obtain a copy
-- of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable... | monte-language/masque | Test.hs | gpl-3.0 | 1,049 | 0 | 13 | 231 | 151 | 86 | 65 | 14 | 1 |
module Sat.GUI.SVGBoardAlt (boardMain,boardMod) where
import Text.Blaze (toValue)
import Text.Blaze.Renderer.String (renderMarkup)
import Text.Blaze.Svg11 ((!), mkPath, l, m, translate, scale)
import qualified Text.Blaze.Svg11 as S
import qualified Text.Blaze.Svg11.Attributes as A
import qualified Data.Map as M
impor... | manugunther/sat | Sat/GUI/SVGBoardAlt.hs | gpl-3.0 | 2,381 | 0 | 16 | 818 | 536 | 315 | 221 | 55 | 1 |
{-# LANGUAGE FunctionalDependencies #-}
module Network.LXD.Client.Internal.Compatibility where
class Compatibility a b | a -> b where
compat :: a -> b
| hverr/haskell-lxd-client | src/Network/LXD/Client/Internal/Compatibility.hs | gpl-3.0 | 156 | 0 | 7 | 26 | 36 | 22 | 14 | -1 | -1 |
{-
The algorithms used for constructing the set of LR(0) items from a DCFG.
This was created as Project 2 for EECS 665 at the University of Kansas.
Author: Ryan Scott
-}
{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
module LR0ItemSet.Algorithm (
lr0ItemSet
, augment
, closure
, goto
) where
import... | RyanGlScott/lr0-item-set | src/LR0ItemSet/Algorithm.hs | gpl-3.0 | 6,020 | 0 | 23 | 1,873 | 1,347 | 688 | 659 | 84 | 3 |
module NoteWindow where
import Graphics.UI.Gtk.General.Structs(Rectangle)
import Graphics.UI.Gtk.Gdk.Region -- for rect intersect
import Graphics.Rendering.Cairo
import Graphics.UI.Gtk
import Data.IORef
-- Everything in here relies on nothing happening whilst drawing a stroke.
-- This is *probably* a safe assumption.... | jamii/inkling | gnote/NoteWindow.hs | gpl-3.0 | 2,750 | 44 | 15 | 602 | 1,085 | 540 | 545 | 72 | 2 |
{-|
Module : Css.Post
Description : Defines the CSS for the post page.
The post page is navigated to by clicking Check My POSt located at the top of
any Courseography page.
-}
module Css.Post
(postStyles) where
import Clay
import Prelude hiding ((**))
import Css.Constants
-- |Defines the CSS for the... | hermish/courseography | app/Css/Post.hs | gpl-3.0 | 5,207 | 0 | 22 | 2,047 | 1,246 | 534 | 712 | 153 | 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/RegionTargetHTTPSProxies/SetURLMap.hs | mpl-2.0 | 5,951 | 0 | 19 | 1,321 | 636 | 378 | 258 | 107 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/DataSets/GetIAMPolicy.hs | mpl-2.0 | 6,668 | 0 | 18 | 1,524 | 944 | 552 | 392 | 136 | 1 |
-- Map loc is read-inly. All dynamic information get fixed with Overlays on the MapBoard of the Battlespace
module Loc where
import Data.Char
import Terrain
import Elevation
data Loc = Loc {
lcTerrain :: Terrain,
lcElevation :: Elevation,
lcTextRepresentation :: String }
deriving (Show)
-- ... | nbrk/datmap2html | Loc.hs | unlicense | 1,109 | 0 | 10 | 288 | 252 | 135 | 117 | 23 | 2 |
module Problem12 where
main =
print $ repli "abc" 3
repli as 0 = []
repli as n = as ++ repli as (n - 1)
| vasily-kartashov/playground | 99-problems/problem-15.hs | apache-2.0 | 109 | 0 | 8 | 31 | 56 | 29 | 27 | 5 | 1 |
module Propellor.Property.SiteSpecific.Branchable where
import Propellor.Base
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.File as File
import qualified Propellor.Property.User as User
import qualified Propellor.Property.Ssh as Ssh
import qualified Propellor.Property.Postfix as Po... | ArchiveTeam/glowing-computing-machine | src/Propellor/Property/SiteSpecific/Branchable.hs | bsd-2-clause | 3,677 | 20 | 33 | 343 | 632 | 351 | 281 | -1 | -1 |
import Data.Array
import qualified Data.Map as M
--import System.IO.Unsafe
-- SegTree
data SegTree a = StLeaf Int a | StNode Int Int a (SegTree a) (SegTree a) deriving (Eq, Ord, Show)
buildrmq acc cs lvs x = acc'
where
updacc (lstseq, lstmap, ix) = (lstseq', lstmap', succ ix)
where
... | pbl64k/HackerRank-Contests | 2014-09-05-FP/ApeWar/aw.ct.hs | bsd-2-clause | 4,677 | 22 | 17 | 1,925 | 2,261 | 1,169 | 1,092 | 108 | 7 |
{-# LANGUAGE OverloadedStrings #-}
-- |Small helper for saving "cleaned up" point cloud data. The idea is
-- that a PCD file is loaded, some processig is done to it, and we
-- want to save the new point set.
module PCDCleaner where
import qualified Data.Vector.Storable as V
import Linear.V3 (V3)
import PCD.Data (saveBi... | acowley/PcdViewer | src/PCDCleaner.hs | bsd-3-clause | 900 | 0 | 11 | 165 | 249 | 146 | 103 | 13 | 1 |
module Challenges.Challenge4 where
import Lib (breakCipher)
import Data.HexString
import System.Environment
import Data.Maybe
import System.Exit
import System.IO (IOMode(ReadMode), openFile, Handle, hIsEOF)
import qualified Data.ByteString as BS
import Control.Monad
secondArg :: [String] -> Maybe String
secondArg (_:... | caneroj1/Crypto-hs | app/Challenges/Challenge4.hs | bsd-3-clause | 775 | 0 | 14 | 147 | 270 | 137 | 133 | 26 | 1 |
-- | This module provides various utility functions for dealing with
-- directory manipulations
module Scoutess.Utils.Directory (copyDir) where
import System.Directory
import System.FilePath
import qualified Codec.Archive.Tar as Tar
import qualified Data.ByteString.Lazy as L
-- | Copies the content of a direct... | cartazio/scoutess | Scoutess/Utils/Directory.hs | bsd-3-clause | 599 | 0 | 11 | 99 | 157 | 87 | 70 | 11 | 1 |
-- | Functions for dealing with lists.
module Data.Lists
( -- * Re-exports
module Data.List
,module Data.List.Split
,module Data.List.Extras
-- * List operations
,list
,unionOf
,for
,lastToMaybe
,firstOr
,maxList
,powerslice
,merge
,mergeBy
,hasAny
,takeWhileList
,dropWhileList
,sp... | chrisdone/lists | src/Data/Lists.hs | bsd-3-clause | 8,330 | 0 | 16 | 2,076 | 2,158 | 1,193 | 965 | 142 | 3 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Gli.Types where
import Data.Aeson
import qualified Data.ByteString.Char8 as B
import Data.Map.Strict as M
import qualified Data.Text as T
import Data.Time
import GHC.Generics ... | goromlagche/gli | src/gli/types.hs | bsd-3-clause | 6,451 | 0 | 11 | 2,991 | 1,242 | 682 | 560 | 135 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Parallel.MPI.Fast
import Data.Array.Storable
import Foreign.C.Types (CInt)
import Control.Monad (forM_)
type Msg = StorableArray Int CInt
bounds :: (Int, Int)
bounds@(lo,hi) = (1,100)
tag :: Tag
tag = 0
main :: IO ()
main = mpiWorld $ \size rank -... | bjpop/haskell-mpi | test/examples/HaskellAndC/Rank1.hs | bsd-3-clause | 739 | 0 | 18 | 207 | 258 | 137 | 121 | 23 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Examples.CodeGeneration.Fibonacci
-- Copyright : (c) Lee Pike, Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Computing Fibonacci numbers and gene... | josefs/sbv | Data/SBV/Examples/CodeGeneration/Fibonacci.hs | bsd-3-clause | 8,630 | 0 | 11 | 1,671 | 490 | 314 | 176 | 25 | 1 |
module Context (
-- * Context
Context (..), vanillaContext, stageContext,
-- * Expressions
getStage, getPackage, getWay, getStagedSettingList, getBuildPath,
withHsPackage,
-- * Paths
contextDir, buildPath, buildDir, pkgInplaceConfig, pkgSetupConfigFile,
pkgHaddockFile, pkgLibraryFile, ... | bgamari/shaking-up-ghc | src/Context.hs | bsd-3-clause | 4,757 | 0 | 13 | 954 | 1,022 | 523 | 499 | -1 | -1 |
{-# LANGUAGE CPP, FlexibleContexts, NoImplicitPrelude,
MultiParamTypeClasses, OverloadedStrings,
RankNTypes #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Generator.ClarisTrans (
Translatable(..), paren,
joinBy, joinEndBy, joinBeginBy, joinBeginEndBy,
headerFile, sourceFile, Context,
typeRepDB, dyna... | nushio3/Paraiso | Language/Paraiso/Generator/ClarisTrans.hs | bsd-3-clause | 9,109 | 0 | 17 | 2,808 | 3,041 | 1,536 | 1,505 | -1 | -1 |
-- | Paragon Parser. Expressions.
module Language.Java.Paragon.Parser.Expressions where
import Prelude hiding (exp)
import Control.Applicative ((<$>))
import Text.ParserCombinators.Parsec
import Language.Java.Paragon.Annotation
import Language.Java.Paragon.Lexer
import Language.Java.Paragon.Syntax.Expressions hiding... | bvdelft/paragon | src/Language/Java/Paragon/Parser/Expressions.hs | bsd-3-clause | 2,935 | 0 | 14 | 603 | 895 | 451 | 444 | 87 | 9 |
{-#LANGUAGE MultiParamTypeClasses #-}
{-#LANGUAGE OverloadedStrings #-}
module Twilio.UsageRecords
( -- * Resource
UsageRecords(..)
, Twilio.UsageRecords.get
) where
import Control.Applicative
import Control.Monad.Catch
import Data.Aeson
import Data.Maybe
import Control.Monad.Twilio
import Twilio.Internal.... | seagreen/twilio-haskell | src/Twilio/UsageRecords.hs | bsd-3-clause | 1,024 | 0 | 9 | 146 | 210 | 123 | 87 | 30 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module Matrixbmp
(
exec) where
import ReadDist
import System.Environment
import Data.Array.Accelerate as A
import Data.Array.Accelerate.IO
import Data.Array.Accelerate.CUDA
import Data.Array.Repa.IO.DevIL
import Data.Array.Repa.Repr.ForeignPtr (F)
import Data.Array.Re... | vmchale/EMD | src/Matrixbmp.hs | bsd-3-clause | 2,044 | 0 | 22 | 404 | 820 | 440 | 380 | 34 | 1 |
{-# LANGUAGE Rank2Types, TypeOperators, FlexibleInstances #-}
module Core.Size where
import Core.FreeVars
import Core.Syntax
import Utilities
type SizedTerm = Sized (TermF Sized)
type SizedFVedTerm = (Sized :.: FVed) (TermF (Sized :.: FVed))
type SizedFVedAlt = AltF (Sized :.: FVed)
type SizedFVedValue = ValueF (S... | batterseapower/chsc | Core/Size.hs | bsd-3-clause | 3,560 | 0 | 17 | 1,053 | 1,225 | 635 | 590 | 65 | 9 |
module Model.Parser where
import Text.ParserCombinators.ReadP
import Control.Monad.IO.Class
import Model.Sudoku
isNumber :: Char -> Bool
isNumber char = elem char ['1'..'9']
number :: ReadP Char
number = satisfy isNumber
digit :: ReadP Digit
digit = number >>= (\i -> case charToDigit i of
Jus... | Bratiakina/sudoku-hs | src/Model/Parser.hs | bsd-3-clause | 829 | 0 | 11 | 181 | 300 | 154 | 146 | 27 | 2 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
-- | A simple interpreter for a subset of Ivory.
module Ivory.Eval
( runEval
, runEvalStartingFrom
, Error
, Eval
, EvalState(EvalState)
, Value(..)
, initState
, openModule
, evalAssert
, eval... | Hodapp87/ivory | ivory-eval/src/Ivory/Eval.hs | bsd-3-clause | 16,177 | 0 | 22 | 4,637 | 6,966 | 3,489 | 3,477 | 404 | 18 |
{-# LANGUAGE QuasiQuotes #-}
-- | This module defines a generator for @getopt_long@ based command
-- line argument parsing. Each option is associated with arbitrary C
-- code that will perform side effects, usually by setting some global
-- variables.
module Futhark.CodeGen.Backends.GenericC.Options
( Option (.... | mrakgr/futhark | src/Futhark/CodeGen/Backends/GenericC/Options.hs | bsd-3-clause | 3,659 | 0 | 12 | 1,057 | 460 | 272 | 188 | 46 | 3 |
module VSimR.Ptr where
import Control.Monad.Trans
import Data.IORef
import System.IO
import System.IO.Unsafe
type Ptr x = IORef x
alloc :: (MonadIO m) => a -> m (Ptr a)
alloc a = liftIO $ newIORef a
write :: (MonadIO m) => Ptr a -> a -> m ()
write ptr a = liftIO $ writeIORef ptr a
deref :: (MonadIO ... | ierton/vsim | src/VSimR/Ptr.hs | bsd-3-clause | 576 | 0 | 10 | 152 | 218 | 114 | 104 | 14 | 1 |
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-}
{-# OPTIONS_GHC -fcontext-stack49 #-}
module Games.Chaos2010.Database.Views where
import Games.Chaos2010.Database.Fields
import Database.HaskellDB.DBLayout
type Views =
Record
(HCons (LVPair Table_catalog (Expr (Maybe String)))
(HCons (LVPai... | JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Views.hs | bsd-3-clause | 967 | 0 | 29 | 297 | 300 | 156 | 144 | 19 | 1 |
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-}
module Fragnix.Declaration
( Declaration(..)
, Genre(..)
, writeDeclarations
) where
import Language.Haskell.Exts (
ModuleName(ModuleName),prettyPrint,Extension)
import Language.Haskell.Names (
Symbol)
import Data.Aeson (
ToJSON(toJSON),object,(.=),
... | phischu/fragnix | src/Fragnix/Declaration.hs | bsd-3-clause | 2,573 | 0 | 21 | 436 | 613 | 343 | 270 | 54 | 1 |
module Kite.Test.Lexer (lexerTests) where
import Test.Tasty
import Test.Tasty.HUnit
import Kite.Test.Exception
import Kite.Lexer
lexerTests = testGroup "Lexer"
[
testCase "Integer" $
alexScanTokens "1" @?= [ TInteger (AlexPn 0 1 1) 1 ]
, testCase "Float" $
alexScanTokens "1.0" @?= [ TFloat (Al... | kite-lang/kite | tests/Kite/Test/Lexer.hs | mit | 1,793 | 0 | 11 | 769 | 523 | 262 | 261 | 37 | 1 |
module Oden.Output.Parser where
import qualified Data.Set as Set
import Text.PrettyPrint.Leijen
import Text.Parsec hiding (unexpected)
import Text.Parsec.Error
import Oden.Output as Output
import Oden.SourceInfo
type ExpectedParts = Set.Set String
type UnexpectedPart = Maybe String
data CondensedMessage = Condensed... | AlbinTheander/oden | src/Oden/Output/Parser.hs | mit | 1,645 | 0 | 17 | 380 | 597 | 301 | 296 | 43 | 4 |
{-# LANGUAGE DeriveDataTypeable #-}
{-
Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
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) ... | Lythimus/lptv | sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Shared.hs | gpl-2.0 | 22,997 | 0 | 18 | 7,073 | 5,335 | 2,863 | 2,472 | 403 | 15 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-cloudtrail/gen/Network/AWS/CloudTrail/CreateTrail.hs | mpl-2.0 | 9,457 | 0 | 21 | 2,189 | 1,333 | 791 | 542 | 140 | 1 |
-- | Maintainer: Zihao Wang <dev@wzhd.org>
--
-- Support for the Pacman package manager <https://www.archlinux.org/pacman/>
module Propellor.Property.Pacman where
import Propellor.Base
runPacman :: [String] -> UncheckedProperty ArchLinux
runPacman ps = tightenTargets $ cmdProperty "pacman" ps
-- | Have pacman updat... | ArchiveTeam/glowing-computing-machine | src/Propellor/Property/Pacman.hs | bsd-2-clause | 2,178 | 22 | 15 | 377 | 669 | 356 | 313 | 44 | 1 |
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
module Main where
import BasePrelude hiding (for_)
import Data.Text (Text)
import Lucid
import Models
data Comment =
Comment { _commentID :: ID
, _commentBody :: Text
, _commentParentID :: ID
, _commentStoryID :: ID
}
--... | hlian/barnacles | ng/src/Main.hs | bsd-3-clause | 4,102 | 0 | 16 | 1,024 | 890 | 418 | 472 | 87 | 1 |
module Usage where
import qualified Definition as D
test :: Int
test = D.s<caret>even + 1
| charleso/intellij-haskforce | tests/gold/codeInsight/QualifiedImport/Usage.hs | apache-2.0 | 93 | 0 | 8 | 19 | 34 | 21 | 13 | -1 | -1 |
{-# LANGUAGE DeriveAnyClass,DeriveGeneric #-}
module Herbie.MathExpr
where
import Control.DeepSeq
import Data.List
import Data.Maybe
import GHC.Generics
import Debug.Trace
import Prelude
ifThenElse True t f = t
ifThenElse False t f = f
-----------------------------------------------------------------------------... | madebyjeffrey/HerbiePlugin | src/Herbie/MathExpr.hs | bsd-3-clause | 8,749 | 0 | 18 | 2,749 | 2,893 | 1,519 | 1,374 | 167 | 9 |
module OldSyntaxRec where
import SyntaxRec
-- For backward compatibility:
type HsPat = HsPatI HsName
type HsType = HsTypeI HsName
type HsExp = HsExpI HsName
type HsDecl = HsDeclI HsName
type HsModuleR = HsModuleRI HsName
type BaseDecl = BaseDeclI HsName
type BaseExp = BaseExpI HsName
type BasePat = BasePatI HsNa... | forste/haReFork | tools/base/syntax/OldSyntaxRec.hs | bsd-3-clause | 491 | 0 | 7 | 90 | 139 | 79 | 60 | 14 | 0 |
module Distribution.Client.Mirror.State (
MirrorState(..)
, MirrorEnv(..)
, mirrorInit
, savePackagesState
, toErrorState
, fromErrorState
) where
-- stdlib
import Control.Exception
import Control.Monad
import Data.Maybe (catMaybes)
import Data.Set (Set)
import Network.URI
import System.Directory
impor... | ocharles/hackage-server | Distribution/Client/Mirror/State.hs | bsd-3-clause | 4,859 | 0 | 17 | 1,127 | 872 | 459 | 413 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses, DeriveGeneric, DeriveDataTypeable #-}
import Control.Applicative
import Control.Lens
import GHC.Generics
import Data.Data
import Data.Data.Lens
data Expr = Var Int | Pos Expr String | Neg Expr | Add Expr Expr deriving (Eq,Ord,Show,Read,Generic,Data,Typeable)
data Stmt = Seq [Stmt] |... | danidiaz/lens | examples/Plates.hs | bsd-3-clause | 884 | 0 | 8 | 188 | 446 | 225 | 221 | 21 | 1 |
{-# LANGUAGE ImplicitParams, RankNTypes #-}
import GHC.Stack
foo :: (?callStack :: CallStack) => [Int]
foo = map (srcLocStartLine . snd) (getCallStack ?callStack)
bar1 :: [Int]
bar1 = foo
bar2 :: [Int]
bar2 = let ?callStack = freezeCallStack ?callStack in foo
main :: IO ()
main = do
print bar1
print bar2
with... | ezyang/ghc | testsuite/tests/typecheck/should_run/T11049.hs | bsd-3-clause | 365 | 0 | 9 | 67 | 126 | 66 | 60 | 13 | 1 |
module Main where
import Q
main = print q
| siddhanathan/ghc | testsuite/tests/cabal/cabal06/r/Main.hs | bsd-3-clause | 42 | 0 | 5 | 9 | 15 | 9 | 6 | 3 | 1 |
import Data.List (transpose)
isTriangle :: (Int, Int, Int) -> Bool
isTriangle (a, b, c) = a + b > c && b + c > a && a + c > b
toInts :: String -> [Int]
toInts line = map (\x -> read x :: Int) $ words line
asTriplet :: [Int] -> (Int, Int, Int)
asTriplet (a:b:c:_) = (a, b, c)
groupBy :: Int -> [String] -> [[String]]
... | ajm188/advent_of_code | 2016/03/Main.hs | mit | 677 | 0 | 13 | 182 | 355 | 185 | 170 | 18 | 1 |
-- module Scheme.Eval.LispError where
-- import Scheme.Lex.LispVal
-- import Control.Monad.Error
-- import Text.ParserCombinators.Parsec
-- -- Data type for handling Errors
-- data LispError = NumArgs Integer [LispVal]
-- | TypeMismatch String LispVal
-- | Parser ParseError
-- ... | johnellis1392/Haskell-Scheme | old/LispError.hs | mit | 1,742 | 0 | 2 | 395 | 37 | 36 | 1 | 1 | 0 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGSVGElement
(js_suspendRedraw, suspendRedraw, js_unsuspendRedraw,
unsuspendRedraw, js_unsuspendRedrawAll, unsuspendRedrawAll,
js_forceRedraw, forceRedraw, js_pauseAnimations, pauseAnimatio... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGSVGElement.hs | mit | 22,329 | 278 | 13 | 3,587 | 4,172 | 2,207 | 1,965 | 319 | 1 |
import Test.Hspec
-- Problem 7
-- Flatten a nested list structure.
-- Transform a list, possibly holding lists as elements into a
-- `flat' list by replacing each list with its elements (recursively).
data NestedList a = Elem a | List [NestedList a]
flatten :: NestedList a -> [a]
flatten ls = flatten' ls []... | baldore/haskell-99-exercises | 7.hs | mit | 834 | 0 | 17 | 198 | 313 | 163 | 150 | 14 | 3 |
{-
**************************************************************
* Filename : Complete.hs *
* Author : Markus Forsberg *
* d97forma@dtek.chalmers.se *
* Last Modified : 6 July, 2001 ... | SAdams601/ParRegexSearch | test/fst-0.9.0.1/FST/Complete.hs | mit | 1,366 | 0 | 13 | 467 | 360 | 191 | 169 | 14 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Util.Monad(
liftExceptions
, whenM
, unlessM
, whenMaybe
, whenMaybeM
) where
import Control.Exception
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.Either
import Control.Monad
import Data.Text (Text)
import TextShow
-- | Catches all sy... | NCrashed/sinister | src/shared/Util/Monad.hs | mit | 1,138 | 0 | 12 | 258 | 413 | 206 | 207 | 32 | 1 |
{-# OPTIONS -Wall #-}
import Data.Functor (($>))
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import Helpers.Graph (Graph, (!))
import qualified Helpers.Graph as Graph
import Helpers.Parse
import Text.Parsec
data Cave = Start | End | Big String | Small String
deriving (Eq, Ord, Sho... | SamirTalwar/advent-of-code | 2021/AOC_12_1.hs | mit | 1,304 | 0 | 15 | 360 | 432 | 224 | 208 | 42 | 3 |
module Wf.Kvs.Redis
( module Wf.Control.Eff.Kvs
, module Wf.Control.Eff.Run.Kvs.Redis
) where
import Wf.Control.Eff.Kvs
import Wf.Control.Eff.Run.Kvs.Redis
| bigsleep/Wf | wf-kvs-redis/src/Wf/Kvs/Redis.hs | mit | 157 | 0 | 5 | 15 | 43 | 32 | 11 | 5 | 0 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
----------------------------------------------------------------------
-- |
-- Module: Web.Slack.Api
-- Description:
--
--
--
----------------------------------------------------------------------
module Web.Slack.Api
... | jpvillaisaza/slack-web | src/Web/Slack/Api.hs | mit | 1,239 | 0 | 9 | 241 | 283 | 173 | 110 | 34 | 1 |
module MarketTransaction
where
import qualified Data.Edison.Assoc.StandardMap as E
import MarketTypes
-- Given a list of things to withdraw and the current market state, returns
-- the new market state without the withdrawn goods, plus a map of quantities
-- of goods that could actually be bought.
withdraw :: Market... | anttisalonen/economics | src/MarketTransaction.hs | mit | 1,148 | 0 | 12 | 243 | 239 | 130 | 109 | 13 | 1 |
repeated :: (a -> a) -> Int -> a -> a
repeated _ 0 x = x
repeated f n x = f (repeated f (n - 1) x)
| fmi-lab/fp-elective-2017 | exercises/11/repeated.hs | mit | 99 | 0 | 9 | 29 | 69 | 35 | 34 | 3 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Foundation where
import qualified Data.Set as S
import Database.Persist.Sql (ConnectionPool, runSqlPool)
import Import.NoFoundation
import LambdaCms.Core
-- import LambdaCmsOrg.Tutorial... | lambdacms/lambdacms.org | lambdacmsorg-base/Foundation.hs | mit | 9,245 | 0 | 16 | 2,551 | 1,468 | 771 | 697 | -1 | -1 |
module Unused.CLI.ProgressIndicator
( I.ProgressIndicator
, createProgressBar
, createSpinner
, progressWithIndicator
) where
import qualified Control.Concurrent.ParallelIO as PIO
import qualified Unused.CLI.ProgressIndicator.Internal as I
import qualified Unused.CLI.ProgressIndicator.Types as I
im... | joshuaclayton/unused | src/Unused/CLI/ProgressIndicator.hs | mit | 1,113 | 0 | 12 | 197 | 335 | 187 | 148 | 23 | 1 |
{-|
Description: Simple abstractions to ease working with reactive-banana.
Copyright: (c) Guilherme Azzi, 2014
License: MIT
Maintainer: ggazzi@inf.ufrgs.br
Stability: experimental
A thin layer on top of reactive-banana to help creating 'Event's and
'Behavior's. Provides two new types: 'EventSource' (mostly a renaming
... | ggazzi/hzen | src/Reactive/Banana/Sources.hs | mit | 2,495 | 0 | 10 | 478 | 372 | 217 | 155 | 32 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, FlexibleInstances #-}
{-# LANGUAGE OverlappingInstances, UndecidableInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables... | maximkulkin/hs-mongodb | Database/MongoDB/Structured/Types.hs | mit | 4,047 | 0 | 12 | 734 | 1,261 | 696 | 565 | 77 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
module Stratosphere.Resources.EC2Volume where
import Stratosphere.ResourceImports
import... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/EC2Volume.hs | mit | 4,530 | 0 | 15 | 611 | 915 | 518 | 397 | 66 | 1 |
-- |
-- Module: Utils.Currency
-- Copyright: (c) Johan Astborg, Andreas Bock
-- License: BSD-3
-- Maintainer: Andreas Bock <bock@andreasbock.dk>
-- Stability: experimental
-- Portability: portable
--
-- Types and functions for HQLs Cash type
module Utils.Currency where
import Prelude hiding (sum)
-- Some... | andreasbock/hql | src/Utils/Currency.hs | gpl-2.0 | 4,093 | 0 | 9 | 1,073 | 1,903 | 950 | 953 | 77 | 1 |
module Tema_14a_PilaConTipoDeDatoAlgebraico_Spec (main, spec) where
import Tema_14.PilaConTipoDeDatoAlgebraico
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "PilaConTipoDeDatoAlgebraico" $ do
it "e1" $
escribePila (apila 1 (apila 2 (apila 3 vacia))) `shouldBe` "1|2|3|-... | jaalonso/I1M-Cod-Temas | test/Tema_14a_PilaConTipoDeDatoAlgebraico_Spec.hs | gpl-2.0 | 858 | 0 | 20 | 214 | 379 | 189 | 190 | 24 | 1 |
module Main where
import Control.Monad.State
import System.IO
import Text.Read (readMaybe)
import Reversi
main :: IO ()
main = do
loop start
displayStrLn "Game Over!"
-- | Run Reversi game loop until game is over.
loop :: Reversi -> IO ()
loop r = do
displayBoard (board r)
when (isActive r) $ do
... | mharrys/reversi | cli/Main.hs | gpl-2.0 | 1,655 | 0 | 14 | 501 | 522 | 247 | 275 | 54 | 2 |
-- module Output (playCsound, playCsounds, lilypond) where
module Output (playCsound, writeCsound) where
-- import Music (Note3, AbstractNote(..), AbstractPitch3(..), AbstractInt3(..), AbstractDur3(..), absolute, AbstractPhrase(..))
import CsoundExp
-- import Csound (testFreqs, playCsound, playCsounds)
-- import Lil... | ejlilley/AbstractMusic | Output.hs | gpl-3.0 | 330 | 0 | 4 | 40 | 19 | 14 | 5 | 2 | 0 |
{-#LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-}
module Carnap.Languages.PurePropositional.Logic.Tomassi
(parseTomassiPL, parseTomassiPLProof, tomassiPLCalc, TomassiPL) where
import Data.Map as M (lookup, Map)
import Text.Parsec
import Control.Lens (view)
import Carnap.Core.Data.Types (F... | opentower/carnap | Carnap/src/Carnap/Languages/PurePropositional/Logic/Tomassi.hs | gpl-3.0 | 5,454 | 0 | 15 | 1,815 | 1,485 | 799 | 686 | 106 | 3 |
-- A Pythagorean triplet is a set of three natural numbers, a < b < c, for which
-- a**2 + b**2 = c**2
-- For example, 3**2 + 4**2 = 9 + 16 = 25 = 5**2.
-- There exists exactly one Pythagorean triplet for which a + b + c = 1000.
-- Find the product abc.
getmn :: [(Integer, Integer)]
getmn = [(m, n) | n <- [3..999], m ... | ignuki/projecteuler | 9/problem9.hs | gpl-3.0 | 672 | 0 | 15 | 201 | 279 | 156 | 123 | 13 | 1 |
module HFlint.Test.FMPZ.Integer
where
import Control.Arrow ( (***) )
import Data.Composition ( (.:) )
import Math.Structure.Tasty
import Test.Tasty ( testGroup, TestTree )
import Test.Tasty.HUnit ( testCase, (@?=), (@=?) )
import qualified Math.Structure as M
import HFlint.FMPZ
import HFlint.Test.Utility.DivisionByZe... | martinra/hflint | test/HFlint/Test/FMPZ/Integer.hs | gpl-3.0 | 3,005 | 0 | 13 | 640 | 766 | 419 | 347 | 68 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.Analytics
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Pu... | brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics.hs | mpl-2.0 | 45,148 | 0 | 91 | 8,780 | 5,151 | 3,715 | 1,436 | 1,172 | 0 |
{-# 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/Get.hs | mpl-2.0 | 5,001 | 0 | 15 | 1,080 | 709 | 417 | 292 | 104 | 1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
-- Module : Gen.Types.Id
-- Copyright : (c) 2015... | brendanhay/gogol | gen/src/Gen/Types/Id.hs | mpl-2.0 | 6,687 | 0 | 18 | 2,106 | 2,247 | 1,191 | 1,056 | 187 | 3 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAG... | nushio3/unittyped | src/UnitTyped/SI/Constants.hs | lgpl-2.1 | 3,153 | 0 | 15 | 564 | 1,021 | 595 | 426 | 47 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : Sound.TagLib
-- Copyright : (c) Brandon Bickford 2008
-- License : LGPL v3
-- Maintainer: Brandon Bickford <bickfordb@gmail.com>
-- Stability : experimental
-- Portability : only tested with GHC
--
-- High level... | bickfordb/haskell-taglib | src/Sound/TagLib.hs | lgpl-3.0 | 10,645 | 0 | 13 | 1,984 | 1,975 | 1,060 | 915 | 149 | 2 |
module Main where
import Types.Cards
import Types.Lists
import Types.Trees
import Types.User
main :: IO ()
main = putStrLn "CombinedTests compiled"
{-
Combined tests are a way of testing that diffrent commands can be run on a file
in one session
-}
{-
Test Purpose: Testing fucntion with several line... | DarrenMowat/blackbox | tests/results/CombinedTests.hs | unlicense | 1,380 | 0 | 8 | 338 | 318 | 171 | 147 | 24 | 1 |
import Control.Monad.Trans.State
fizzBuzz :: Integer -> String
fizzBuzz n | n `mod` 15 == 0 = "FizzBuzz"
| n `mod` 5 == 0 = "Fizz"
| n `mod` 3 == 0 = "Buzz"
| otherwise = show n
fizzBuzzList :: [Integer] -> [String]
fizzBuzzList list =
execState (mapM_ addResult list) []
... | dmvianna/haskellbook | src/Ch23-FizzBuzz.hs | unlicense | 725 | 0 | 11 | 206 | 334 | 167 | 167 | 22 | 1 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE OverloadedStrings #-}
module HttpRequestParser where
import Text.ParserCombinators.Parsec
import qualified Data.IntSet as S
data HttpRequest = HttpRequest {
request :: HttpRequestLine,
headers :: [Header],
body :: Maybe String -- todo
} deriving ... | songpp/halo | src/HttpRequestParser.hs | apache-2.0 | 2,020 | 0 | 11 | 514 | 666 | 336 | 330 | 61 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Finance.Hqfl.Instrument
-- Copyright : (C) 2018 Mika'il Khan
-- License : (see the file LICENSE)
-- Maintainer : Mika'il Khan <co.category@gmail.com>
-- Stability : stable
-- Portability : portable
--
----... | cokleisli/hqfl | src/Finance/Hqfl/Instrument.hs | apache-2.0 | 1,748 | 0 | 5 | 262 | 244 | 181 | 63 | 32 | 0 |
-- Convention used below:
-- when 'name' and 'nameCT' both appear, 'name' is the Haskell function and
-- 'nameCT' is the "Code Template" that 'name' builds.
module Drasil.GlassBR.ModuleDefs (allMods, implVars, interpY, interpZ) where
import Language.Drasil
import Language.Drasil.ShortHands
import Language.Drasil.Code... | JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/GlassBR/ModuleDefs.hs | bsd-2-clause | 8,040 | 0 | 14 | 2,026 | 2,668 | 1,433 | 1,235 | 158 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DeriveGeneric #-}
module Nero.Payload
(
-- * Payload
Payload
, payloadText
, defaultPayload
, defaultPayloadForm
, Encoding
, utf8Encoding
, HasPayload(..)
-- * Body
, Body
, HasBody(..)
-- * Form
, form
) where
import GHC.Generics (Generic)
imp... | plutonbrb/nero | src/Nero/Payload.hs | bsd-3-clause | 1,906 | 0 | 9 | 458 | 398 | 223 | 175 | 48 | 2 |
module Language.MicroKanren (module MK) where
import Language.MicroKanren.Core as MK
import Language.MicroKanren.Extended as MK
import Language.MicroKanren.Reify as MK
| joneshf/MicroKanren | src/Language/MicroKanren.hs | bsd-3-clause | 176 | 0 | 4 | 25 | 36 | 26 | 10 | 4 | 0 |
module Main where
import Numeric.LinearAlgebra
import Common
import Forward
import BackProp
import AutoEncoder
import ActivFunc
import Other
main :: IO ()
main = do
regression
classification
regression :: IO ()
regression = do
ws <- genWeights [2, 4, 8, 1]
let x = matrix 4 [0, 0, 1, 1,
0,... | pupuu/deep-neuralnet | app/Main.hs | bsd-3-clause | 2,075 | 0 | 13 | 544 | 770 | 382 | 388 | 60 | 1 |
module Codegen.TigerCodegen where
-- Tiger compiler bindings
import Tiger.TigerLanguage
import Codegen.TigerSymbolTable
import Codegen.TigerEnvironment
-- LLVM bindings
import qualified LLVM.General.AST as AST
import qualified LLVM.General.AST.Type as Type
import qualified LLVM.General.AST.Global as Global
import qua... | lialan/TigerCompiler | app/Codegen/TigerCodegen.hs | bsd-3-clause | 7,535 | 0 | 18 | 1,463 | 2,585 | 1,318 | 1,267 | -1 | -1 |
-- | Module definining the 6502 architecture.
module Arch6502 where
import Data.Bits
import Data.Word
-- |All supported 6502 Mnemonics
data Mnemonic = ADC -- ^ Add with carry
| AND -- ^ And (with accumulator)
| ASL -- ^ Arithmetic shift left
| BCC -- ^ Branch on carr... | m-schmidt/Asm6502 | src/Arch6502.hs | bsd-3-clause | 10,263 | 0 | 11 | 4,129 | 2,412 | 1,218 | 1,194 | 292 | 164 |
-- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_C
-- Card Game
-- input:
-- 3
-- cat dog
-- fish fish
-- lion tiger
-- output:
-- 1 7
import Control.Applicative ((<$>))
import qualified Control.Monad as Monad (replicateM)
type Hands = [String]
type Points = [Int]
main = do
n <- read <$> getL... | ku00/aoj-haskell | src/ITP1_9_C.hs | bsd-3-clause | 676 | 0 | 10 | 150 | 249 | 139 | 110 | 16 | 1 |
-- |
-- Module : Simulation.Aivika.Experiment.Chart.Utils
-- Copyright : Copyright (c) 2012-2017, David Sorokin <david.sorokin@gmail.com>
-- License : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability : experimental
-- Tested with: GHC 8.0.1
--
-- The module defines some utilities used... | dsorokin/aivika-experiment-chart | Simulation/Aivika/Experiment/Chart/Utils.hs | bsd-3-clause | 1,275 | 0 | 10 | 209 | 244 | 133 | 111 | -1 | -1 |
{- Test/Main.hs
The units Package
Copyright (c) 2014 Richard Eisenberg
eir@cis.upenn.edu
This is the main testing file for the units package.
-}
{-# LANGUAGE ImplicitParams #-}
module Tests.Main where
import qualified Tests.Compile.CGS ()
import qualified Tests.Compile.EvalType (... | hesiod/units | Tests/Main.hs | bsd-3-clause | 1,638 | 0 | 9 | 341 | 307 | 202 | 105 | 42 | 1 |
-- | More HUnit practice
-- -- tutoralial located at: <https://leiffrenzel.de/papers/getting-started-with-hunit.html>
module FindIdentifier (findIdentifier) where
import Data.List( sort )
import Data.Maybe
import Data.Generics
import Language.Haskell.Parser
import Language.Haskell.Syntax
findIdentifier :: String... | emaphis/Haskell-Practice | testing-project/src/FindIdentifier.hs | bsd-3-clause | 1,834 | 0 | 12 | 354 | 592 | 320 | 272 | -1 | -1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-orphans -fno-... | WraithM/peertrader-backend | src/PeerTrader/AutoFilter/AutoFilter.hs | bsd-3-clause | 6,909 | 0 | 13 | 1,706 | 1,480 | 769 | 711 | 149 | 2 |
{-# LANGUAGE TypeFamilies #-}
----------------------------------------------------------------------
-- |
-- Module : Data.Functor.Representable.Trie.Bool
-- Copyright : (c) Edward Kmett 2011
-- License : BSD3
--
-- Maintainer : ekmett@gmail.com
-- Stability : experimental
--
----------------------... | ekmett/representable-tries | src/Data/Functor/Representable/Trie/Bool.hs | bsd-3-clause | 3,013 | 0 | 10 | 598 | 1,151 | 582 | 569 | 71 | 1 |
module Main where
import PBKDF2
import Control.Monad
import Control.DeepSeq
import System.CPUTime
import Text.Printf
main :: IO ()
main =
do putStrLn "start"
test 1
test 10
test 100
test 1000
putStrLn "end"
test :: Int -> IO ()
test n =
do start <- getCPUTime
((iterate sha1 msg) !! ... | markus-git/PBKDF2 | src/Main.hs | bsd-3-clause | 490 | 0 | 14 | 130 | 198 | 98 | 100 | 21 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.