_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
b430deed245b2e7402c74ecd7c9d4742bc5207513d17e0fa686bfbe27946adc2 | RichiH/git-annex | V0.hs | git - annex v0 - > v1 upgrade support
-
- Copyright 2010 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2010 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Upgrade.V0 where
import Annex.Common
import Annex.Content
import qualified Upgrade.V1... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Upgrade/V0.hs | haskell | do the reorganisation of the key files
update the symlinks to the key files
these stayed unchanged between v0 and v1 | git - annex v0 - > v1 upgrade support
-
- Copyright 2010 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2010 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Upgrade.V0 where
import Annex.Common
import Annex.Content
import qualified Upgrade.V1... |
36ce114f4b7b99e2c86c624fc8f0b1a0e87aa858c1859f7f84a4b439517ffbd9 | nuprl/gradual-typing-performance | scheme.rkt | #lang racket/base
(require "racket.rkt")
(provide (all-from-out "racket.rkt"))
| null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/scribble-lib/scribble/scheme.rkt | racket | #lang racket/base
(require "racket.rkt")
(provide (all-from-out "racket.rkt"))
| |
2d3563cd56e2db8d7f7d3e5b737f2fc7acf773852a06e78cb9dbc0dae9e31351 | Jaxan/nominal-lstar | RunningExample.hs | {-# language DeriveAnyClass #-}
# language DeriveGeneric #
{-# language TupleSections #-}
module Examples.RunningExample where
In this file we define the running example of the paper
The language is L_n = { ww | w \in A^n } for any alphabet A.
In terms of orbits , the minimal acceptor is quite large ,
... | null | https://raw.githubusercontent.com/Jaxan/nominal-lstar/98f9c6e295583a7ea52e528665f50af855ad852b/src/Examples/RunningExample.hs | haskell | # language DeriveAnyClass #
# language TupleSections #
these define the states
this is the general shape of an transition | # language DeriveGeneric #
module Examples.RunningExample where
In this file we define the running example of the paper
The language is L_n = { ww | w \in A^n } for any alphabet A.
In terms of orbits , the minimal acceptor is quite large ,
but in terms of FO definable sets it is quite small .
The... |
a7e4aa9e4d5ae857a3957352875ca1ff78891dbb1c0bb6aac6faa6f4becd1f81 | zliu41/multi-containers | Multimap.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.Multimap
Maintainer : < >
--
-- Multimaps, where values behave like (non empty) lists.
--
Multimaps whose values behave like sets are in " Data . Multimap . Set " .
Multimaps whose values behave like m... | null | https://raw.githubusercontent.com/zliu41/multi-containers/3711e7c8640282d26e948e9074ed576a31138ed7/src/Data/Multimap.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Multimap
Multimaps, where values behave like (non empty) lists.
* 'lookup' (or '!') returns a possibly empty list. Unlike regular maps,
the '!' operator is total for multimaps.
* Functions like 'map', 'a... | Maintainer : < >
Multimaps whose values behave like sets are in " Data . Multimap . Set " .
Multimaps whose values behave like maps ( i.e. , two - dimensional
tables ) are in " Data . Multimap . Table " .
The implementation is backed by a @'Map ' k ( ' NonEmpty ' a)@. The
differences between @'Multim... |
87a215c0bd5f31e7bb3d882d155bab7bcaebd7b78229495864cb348e8120fe17 | rcherrueau/APE | car-modules.rkt | #lang reader "../lang.rkt"
(import [Prelude "prelude.rkt"])
Figure 1 : Car example
(class Engine
(def (start -> Prelude.Unit) ???)
(def (stop -> Prelude.Unit) ???))
(class Driver #;... )
(class Car
;; `engine` is bound to the context of Car instances
(field [engine : rep/Engine])
;; `driver` is bound t... | null | https://raw.githubusercontent.com/rcherrueau/APE/8b5302709000bd043b64d46d55642acb34ce5ba7/racket/CPN98/examples/car-modules.rkt | racket | ... )
`engine` is bound to the context of Car instances
`driver` is bound to the world context
New engine as part of the Car instance
No owner implicitly means world
;; fails -- by giving `engine` the ownership type `rep`, then engine
;; belongs to `car`. It is not accessible outside of this instance
;; and ther... | #lang reader "../lang.rkt"
(import [Prelude "prelude.rkt"])
Figure 1 : Car example
(class Engine
(def (start -> Prelude.Unit) ???)
(def (stop -> Prelude.Unit) ???))
(class Car
(field [engine : rep/Engine])
(field [driver : world/Driver])
(def (init -> Θ/Car)
(set-field! this engine (new rep/Engine... |
fda7db99b5c1d633f93bf7540555e7f82a4453b237ae01d26154635a3cf8373e | nponeccop/HNC | Inliner2.hs | # LANGUAGE GADTs , TypeFamilies , NoMonomorphismRestriction #
module HN.Optimizer.Inliner2 (runB) where
import Compiler.Hoopl
import HN.Intermediate
import HN.Optimizer.ExpressionRewriter
import HN.Optimizer.Node
import HN.Optimizer.Pass
import HN.Optimizer.Utils
Идея - использовать Hoopl как фреймворк ,
а не... | null | https://raw.githubusercontent.com/nponeccop/HNC/d8447009a04c56ae2cba4c7c179e39384085ea00/HN/Optimizer/Inliner2.hs | haskell | data Node0 e x where
Node0 : : Label - > [ Label ] - > Node0 C С
для блоков из одного СС - узла foo x = {
data Node0 e x where
Node0 :: Label -> [Label] -> Node0 C С
для блоков из одного СС-узла нет вспомогательных функций
BACKWARD pass
Rewriting: inline definition - rewrite Exit nodes ("call sites") to
... | # LANGUAGE GADTs , TypeFamilies , NoMonomorphismRestriction #
module HN.Optimizer.Inliner2 (runB) where
import Compiler.Hoopl
import HN.Intermediate
import HN.Optimizer.ExpressionRewriter
import HN.Optimizer.Node
import HN.Optimizer.Pass
import HN.Optimizer.Utils
Идея - использовать Hoopl как фреймворк ,
а не... |
a842f752a9f05723fb517f747d19519563966163a2dca6c6f0a93f09d4e33420 | vim-scripts/slimv.vim | swank-sbcl.lisp | ;;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
swank-sbcl.lisp --- SLIME backend for SBCL .
;;;
Created 2003 , < >
;;;
;;; This code has been placed in the Public Domain. All warranties are
;;; disclaimed.
;;; Requires the SB-INTROSPECT contrib.
Administrivia
(in-package :swank-backend)
(eval-when (:... | null | https://raw.githubusercontent.com/vim-scripts/slimv.vim/61ce81ff6b1a05314a6d750a32a1c7379f35a5dc/slime/swank-sbcl.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
This code has been placed in the Public Domain. All warranties are
disclaimed.
Requires the SB-INTROSPECT contrib.
backwards compability tests
Generate a form suitable for testing for stepper support (0.9.17)
with #+.
Ditto for weak hash-tables
swank-mop
Declare r... | swank-sbcl.lisp --- SLIME backend for SBCL .
Created 2003 , < >
Administrivia
(in-package :swank-backend)
(eval-when (:compile-toplevel :load-toplevel :execute)
(require 'sb-bsd-sockets)
(require 'sb-introspect)
(require 'sb-posix)
(require 'sb-cltl2))
(declaim (optimize (debug 2)
... |
5d3bf18b46ebf044338513dc102fa49d6ed0be48a9c504a7f8c79198fc50b4d8 | cartazio/tlaps | m_dep.mli |
* Copyright ( C ) 2011 INRIA and Microsoft Corporation
* Copyright (C) 2011 INRIA and Microsoft Corporation
*)
open M_t;;
module /
val external_deps : mule_ Property.wrapped -> Util.Coll.Hs.t;;
(* tlapm.ml *)
val schedule : modctx -> modctx * mule list;;
| null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/module/m_dep.mli | ocaml | tlapm.ml |
* Copyright ( C ) 2011 INRIA and Microsoft Corporation
* Copyright (C) 2011 INRIA and Microsoft Corporation
*)
open M_t;;
module /
val external_deps : mule_ Property.wrapped -> Util.Coll.Hs.t;;
val schedule : modctx -> modctx * mule list;;
|
2a3cf6a95b8d732518181afbc066ac0b78e7e2450b3db66f1626b39b14cc57c3 | mikpe/pdp10-tools | sim_arithmetic_tests.erl | -*- erlang - indent - level : 2 -*-
%%%
simulator for pdp10 - elf
Copyright ( C ) 2020
%%%
This file is part of pdp10 - tools .
%%%
pdp10 - tools 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 ,... | null | https://raw.githubusercontent.com/mikpe/pdp10-tools/99216b63317fe5b5ac18f1a0d3c81b464f8b8f40/erlang/apps/sim/test/sim_arithmetic_tests.erl | erlang |
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
=============================================================================
LEFT,,RIGHT in MACRO-10
... | -*- erlang - indent - level : 2 -*-
simulator for pdp10 - elf
Copyright ( C ) 2020
This file is part of pdp10 - tools .
pdp10 - tools 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 vers... |
359d12c8cfac51b01dda370c6b74041f2038686382a692cd0f68bd1b207f3140 | bschwb/cis194-solutions | hanoi.hs | # OPTIONS_GHC -Wall #
module Hanoi where
type Peg = String
type Move = (Peg, Peg)
Return list of moves to move n discs from the first to the second .
-- hanoi 2 "a" "b" "c" == [("a","c"), ("a","b"), ("c","b")]
1 . move n-1 discs from a to c using b as temporary storage
2 . move the top disc from a to b
3 . ... | null | https://raw.githubusercontent.com/bschwb/cis194-solutions/e79f96083b6edbfed18a2adbc749c41d196d8ff7/01-intro/hanoi.hs | haskell | hanoi 2 "a" "b" "c" == [("a","c"), ("a","b"), ("c","b")] | # OPTIONS_GHC -Wall #
module Hanoi where
type Peg = String
type Move = (Peg, Peg)
Return list of moves to move n discs from the first to the second .
1 . move n-1 discs from a to c using b as temporary storage
2 . move the top disc from a to b
3 . move n-1 discs from c to b using a as temporary storage
hano... |
f9765dc1e8eb3a25a13cc3d888d723261b9cbf2624a6580634368bab68ab786f | GlideAngle/flare-timing | Chunk.hs | # LANGUAGE DuplicateRecordFields #
module Flight.Gap.Distance.Chunk
( Lookahead(..)
, Chunk(..)
, Chunks(..)
, IxChunk(..)
, ChunkRelativeDifficulty(..)
, ChunkDifficultyFraction(..)
, ChunkLandings(..)
, ChunkDifficulty(..)
, lookahead
, toIxChunk
, collectDowns
, toChun... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/34873946be9b93c37048ed118ef5b4649c71d630/lang-haskell/gap-effort/library/Flight/Gap/Distance/Chunk.hs | haskell | equal to minimum distance.
| The relative difficulty for this chunk.
| The difficulty fraction for this chunk.
| Pilots down in this chunk. The @downs@ and @downers@ fields can be zipped.
^ How many pilots are down in this chunk.
^ The distance each of the downers came down.
^ The pilots that landed in this chun... | # LANGUAGE DuplicateRecordFields #
module Flight.Gap.Distance.Chunk
( Lookahead(..)
, Chunk(..)
, Chunks(..)
, IxChunk(..)
, ChunkRelativeDifficulty(..)
, ChunkDifficultyFraction(..)
, ChunkLandings(..)
, ChunkDifficulty(..)
, lookahead
, toIxChunk
, collectDowns
, toChun... |
68a75aa4ab39c7805feaafda2492b6215f191ec07a61bc983584b4b738ebd9d9 | hirokai/PaperServer | Defs.hs | # LANGUAGE TemplateHaskell , DeriveDataTypeable #
module Model.Defs where
import Prelude
import Database.Persist.Class
import Database.Persist.Sql
import Data.Text (Text)
import Data.Maybe
import qualified Data.Text as T
import Data.Aeson.TH
import Data.Char
import qualified Parser.Paper as P
import Data.Typeable
typ... | null | https://raw.githubusercontent.com/hirokai/PaperServer/b577955af08660253d0cd11282cf141d1c174bc0/Model/Defs.hs | haskell | # LANGUAGE TemplateHaskell , DeriveDataTypeable #
module Model.Defs where
import Prelude
import Database.Persist.Class
import Database.Persist.Sql
import Data.Text (Text)
import Data.Maybe
import qualified Data.Text as T
import Data.Aeson.TH
import Data.Char
import qualified Parser.Paper as P
import Data.Typeable
typ... | |
677f6c2aef35683425fe887e441a1361624daf3ac6bf0aa8664a9ac6d7ba16b4 | onedata/op-worker | storage_traverse_job.erl | %%%-------------------------------------------------------------------
@author
( C ) 2019 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%%--------------------------------------------------------------------
%%% @doc
%%% Model for persisting storage_traverse jobs... | null | https://raw.githubusercontent.com/onedata/op-worker/b09f05b6928121cec4d6b41ce8037fe056e6b4b3/src/modules/datastore/models/storage/traverse/storage_traverse_job.erl | erlang | -------------------------------------------------------------------
--------------------------------------------------------------------
@doc
Model for persisting storage_traverse jobs.
@end
-------------------------------------------------------------------
API
datastore_model callbacks
==========================... | @author
( C ) 2019 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(storage_traverse_job).
-author("Jakub Kudzia").
-include("global_definitions.hrl").
-include("modules/storage/traverse/storage_traverse.hrl").
-include("modules/datastore/datastore_models.h... |
28e5112581af5ad64c521b947a379f11b98df5fe8f3467f6b28c9633a3d54ebf | vseloved/cl-agraph | test-core.lisp | CL - AGRAPH core test
( c ) Vsevolod Dyomkin . see LICENSE file for permissions
(in-package :agraph)
(deftest triple ()
(should be string= "/"
(register-prefix "foo" "/"))
(let ((tr (<> (make-blank-node) "rdf:type" (uri "foo:quux"))))
(should be eql 'blank-node (type-of (s tr)))
(should be e... | null | https://raw.githubusercontent.com/vseloved/cl-agraph/e605b34fa57a9ede6fb6cc13ef82fc3438898567/test/test-core.lisp | lisp | CL - AGRAPH core test
( c ) Vsevolod Dyomkin . see LICENSE file for permissions
(in-package :agraph)
(deftest triple ()
(should be string= "/"
(register-prefix "foo" "/"))
(let ((tr (<> (make-blank-node) "rdf:type" (uri "foo:quux"))))
(should be eql 'blank-node (type-of (s tr)))
(should be e... | |
e94d17fcc16baae758b713ab7f779092f2ce68365bc7b8c3d045e754fb5fa1f9 | NorfairKing/smos | Gen.hs | # OPTIONS_GHC -fno - warn - orphans #
module Smos.Cursor.Contents.Gen where
import Cursor.List.NonEmpty.Gen
import Cursor.Text.Gen
import Cursor.TextField
import Cursor.TextField.Gen ()
import Data.GenValidity
import Data.GenValidity.Text
import Smos.Cursor.Contents
import Smos.Data
import Test.QuickCheck
instance G... | null | https://raw.githubusercontent.com/NorfairKing/smos/f72b26c2e66ab4f3ec879a1bedc6c0e8eeb18a01/smos-cursor-gen/src/Smos/Cursor/Contents/Gen.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module Smos.Cursor.Contents.Gen where
import Cursor.List.NonEmpty.Gen
import Cursor.Text.Gen
import Cursor.TextField
import Cursor.TextField.Gen ()
import Data.GenValidity
import Data.GenValidity.Text
import Smos.Cursor.Contents
import Smos.Data
import Test.QuickCheck
instance G... | |
3a882379ed8962fdbd20447770da3a831deba27d4afaa2253b034c6b1663de84 | SRI-CSL/yices2_ocaml_bindings | types_test.ml | open Yices2.High
module EH1 = Make(ExceptionsErrorHandling)
let test () =
print_endline "Types tests";
let open EH1 in
let open Global in
init();
let bool_t = Type.bool() in
let int_t = Type.int() in
assert(not Type.(equal bool_t int_t));
let real_t = Type.real() in
assert(not Type.(equal real_t... | null | https://raw.githubusercontent.com/SRI-CSL/yices2_ocaml_bindings/16e91100f82079576d63cbc3c49962178b79dfb9/src_tests/types_test.ml | ocaml | open Yices2.High
module EH1 = Make(ExceptionsErrorHandling)
let test () =
print_endline "Types tests";
let open EH1 in
let open Global in
init();
let bool_t = Type.bool() in
let int_t = Type.int() in
assert(not Type.(equal bool_t int_t));
let real_t = Type.real() in
assert(not Type.(equal real_t... | |
3f766b58ccab25fc037e827387c2a22261475e54df39ef80dece3e6880c1f46b | haskell/haskell-ide-engine | HoverSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module HoverSpec where
import Control.Applicative.Combinators
import Control.Lens
import Control.Monad.IO.Class
import qualified Data.Text as T
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.Types
import Language.Haskell.LSP.Types.Lens
import Test.Hspec
import TestUtils... | null | https://raw.githubusercontent.com/haskell/haskell-ide-engine/d84b84322ccac81bf4963983d55cc4e6e98ad418/test/functional/HoverSpec.hs | haskell | # LANGUAGE OverloadedStrings # | module HoverSpec where
import Control.Applicative.Combinators
import Control.Lens
import Control.Monad.IO.Class
import qualified Data.Text as T
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.Types
import Language.Haskell.LSP.Types.Lens
import Test.Hspec
import TestUtils
spec :: Spec
spec = describe "hov... |
03375cc182ab1962525432405f1af5e1d0b43d05e10419a6f824bf0421df45fc | nasser/magic | tests.clj | (ns magic.tests
(:refer-clojure :exclude [methods])
(:import Activator IFn)
(:require [mage.core :as il])
(:use magic.core)
(:use clojure.pprint
clojure.test))
;; test gen
(defn types [asm]
(->> asm
assembly-load
(.GetTypes)))
(defn methods [asm flags]
(->> asm
types
... | null | https://raw.githubusercontent.com/nasser/magic/7a46f773bc7785c82d9527d52c1a8c28ac16e195/src/magic/tests.clj | clojure | test gen
this will change when the magic api settles down
:mage.core/assembly-builder
first
nil
strings
boolean
numbers
chars
types
lists
vectors
maps
symbols
keywords
invoke
regexp
regexps arent values, is str the best test?
regexps arent values, is str the best test?
new expr
instance propert... | (ns magic.tests
(:refer-clojure :exclude [methods])
(:import Activator IFn)
(:require [mage.core :as il])
(:use magic.core)
(:use clojure.pprint
clojure.test))
(defn types [asm]
(->> asm
assembly-load
(.GetTypes)))
(defn methods [asm flags]
(->> asm
types
(mapcat #(.G... |
31123834c14c19a03d9efb26a405dea0525b854a15edb4a8b240926479c401b6 | reborg/clojure-essential-reference | 3.clj | (import '[java.net URL])
(import '[java.util.zip ZipInputStream])
(require '[clojure.java.io :as io])
(def alexa "-static/top-1m.csv.zip")
< 1 >
(-> (URL. url)
.openConnection
.getInputStream
ZipInputStream.
(doto .getNextEntry)
io/reader))
< 2 >
(some-> line (.split "\\.") last))
(d... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/SequentialGeneration/OtherGenerators/line-seq/3.clj | clojure | <3>
"340,xx1.me" | (import '[java.net URL])
(import '[java.util.zip ZipInputStream])
(require '[clojure.java.io :as io])
(def alexa "-static/top-1m.csv.zip")
< 1 >
(-> (URL. url)
.openConnection
.getInputStream
ZipInputStream.
(doto .getNextEntry)
io/reader))
< 2 >
(some-> line (.split "\\.") last))
(... |
3e9c9f58aa1f2e38204f68e8cca717e9b1d46a933bea7a3af0195d658ad2599d | hellonico/origami-fun | touring.clj | (ns opencv4.touring
(:require
[opencv4.utils :as u]
[opencv4.core :refer :all]))
(def img
(-> "resources/morph/hammer2.png"
imread
pyr-down!
))
(def ret (-> img
clone
(cvt-color! COLOR_BGR2GRAY)
(threshold! 127 255 THRESH_BINARY)
))
( u / show ret )
(def contours (new-arraylist))
(... | null | https://raw.githubusercontent.com/hellonico/origami-fun/80117788530d942eaa9a80e2995b37409fa24889/test/opencv4/touring.clj | clojure | (ns opencv4.touring
(:require
[opencv4.utils :as u]
[opencv4.core :refer :all]))
(def img
(-> "resources/morph/hammer2.png"
imread
pyr-down!
))
(def ret (-> img
clone
(cvt-color! COLOR_BGR2GRAY)
(threshold! 127 255 THRESH_BINARY)
))
( u / show ret )
(def contours (new-arraylist))
(... | |
b1799244ce65f584cfdd90f94884e569fd6a63668f40e40f393e56abdb964a85 | defaultxr/cl-collider-tutorial | grains.lisp | (in-package :sc)
(defugen (grain-sin "GrainSin") (&optional (numchan 1) (trig 0) (dur 1) (freq 440)
(pan 0.0) (envbufnum -1) (max-grains 512)
&key (mul 1.0) (add 0.0))
((:ar (madd (multinew new 'multiout-ugen numchan trig dur freq pan envbufnum max-grains)
mul add))))
(defugen (grain-fm "Grai... | null | https://raw.githubusercontent.com/defaultxr/cl-collider-tutorial/266ae3e6aaa16d35695266ec884c30626fc8e38d/cl-collider/ugens/grains.lisp | lisp | (in-package :sc)
(defugen (grain-sin "GrainSin") (&optional (numchan 1) (trig 0) (dur 1) (freq 440)
(pan 0.0) (envbufnum -1) (max-grains 512)
&key (mul 1.0) (add 0.0))
((:ar (madd (multinew new 'multiout-ugen numchan trig dur freq pan envbufnum max-grains)
mul add))))
(defugen (grain-fm "Grai... | |
e12c7abba536ac38d47a49bcde4c9ba6d5e756a985d25db211a0174d007359ba | tip-org/tools | Repr.hs | # LANGUAGE DeriveFunctor , , DeriveTraversable #
| A representation of programs
module Tip.Haskell.Repr where
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
data Decls a = Decls [Decl a]
deriving (Eq,Ord,Show,Functor,Traversable,Foldable)
data Decl a
= TySig a
[Type a] {- cla... | null | https://raw.githubusercontent.com/tip-org/tools/34350072587bd29157d18331eb895a1b2819555f/tip-lib/src/Tip/Haskell/Repr.hs | haskell | class contexts
type constructor name
type variables
constructors
context
head
declarations (associated types and fun decls)
context
head
declarations (type signatures)
a literal list
a literal tuple
string from a name...
| @return ()@
Template Haskell ''
Template Haskell $(..)
record update | # LANGUAGE DeriveFunctor , , DeriveTraversable #
| A representation of programs
module Tip.Haskell.Repr where
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
data Decls a = Decls [Decl a]
deriving (Eq,Ord,Show,Functor,Traversable,Foldable)
data Decl a
= TySig a
(Type a)
| Fu... |
ce742a12364acb46c584982bc7a4d43ded53380900d33ddbb7b9c23bd6e0eeb1 | vitorenesduarte/tricks | tricks_driver_socket.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2018 . All Rights Reserved .
%%
This file is provided to you 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 ... | null | https://raw.githubusercontent.com/vitorenesduarte/tricks/9ba11252be128be481b4d4a00fe162ccdbdac501/src/tricks_driver_socket.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2018 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(tricks_driver_socket... |
ee7ab8623933530839c429fce240c97d763060dfd0fbd1d93f91fd821c7f66d9 | jwiegley/notes | Produce.hs | {-# LANGUAGE OverloadedStrings #-}
module Produce where
import Data.ByteString
import Pipes
import Pipes.Prelude
axman6 :: Monad m => Producer ByteString m () -> Producer ByteString m ()
axman6 src = for src yield
| null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/Produce.hs | haskell | # LANGUAGE OverloadedStrings # |
module Produce where
import Data.ByteString
import Pipes
import Pipes.Prelude
axman6 :: Monad m => Producer ByteString m () -> Producer ByteString m ()
axman6 src = for src yield
|
85c08bdfbdb4bd89c764aca45e23a4b02aa5b7ba3ab9167cdcc192f6992589a5 | dwayne/eopl3 | ex2.20.rkt | #lang racket
(require (prefix-in bintree: "./ex2.19.rkt"))
;; Bidirectional binary trees
;;
;; Allows for moving up and down (left/right) seemlessly.
;;
BiBintree : : = ( ) ) )
;; Direction ::= left | right
(define (number->bi-bintree n)
(list (bintree:number->bintree n) '()))
(define (bi-bintree->bintree bt... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/02-ch2/racket/ex2.20.rkt | racket | Bidirectional binary trees
Allows for moving up and down (left/right) seemlessly.
Direction ::= left | right | #lang racket
(require (prefix-in bintree: "./ex2.19.rkt"))
BiBintree : : = ( ) ) )
(define (number->bi-bintree n)
(list (bintree:number->bintree n) '()))
(define (bi-bintree->bintree bt)
(car bt))
(define (bi-bintree->ancestors bt)
(cadr bt))
(define (at-leaf? bt)
(bintree:at-leaf? (bi-bintree->bintr... |
2d4ba6f3307116faa1702a61db8809a5bc9e3431c853fa38531aed4786d45e36 | data61/Mirza | Blockchain.hs | module Mirza.SupplyChain.Tests.Blockchain where
Tests that should be implemented here
Check for tampering by comparing to Blockchain hash
eventInfo ← eventInfo(eventID )
joseTxt = joseText eventInfo
expectedHash = hash joseText
blockchainID = blockchainID eventInfo
bcHash = getBlockchainHash(blockcha... | null | https://raw.githubusercontent.com/data61/Mirza/24e5ccddfc307cceebcc5ce26d35e91020b8ee10/projects/or_scs/test/Mirza/SupplyChain/Tests/Blockchain.hs | haskell | module Mirza.SupplyChain.Tests.Blockchain where
Tests that should be implemented here
Check for tampering by comparing to Blockchain hash
eventInfo ← eventInfo(eventID )
joseTxt = joseText eventInfo
expectedHash = hash joseText
blockchainID = blockchainID eventInfo
bcHash = getBlockchainHash(blockcha... | |
8ffaf3863037e1f49976dc55e0554b387b13796b3ba1ff644e6c0d69a57631d0 | boxer-project/boxer-sunrise | host.lisp | -*- Mode : Lisp ; rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / host.lisp , v 1.4.15.1 2017/01/19 11:51:03 martin Exp $ " -*-
Copyright ( c ) 1987 - -2017 LispWorks Ltd. All rights reserved .
(in-package "USER")
(setf (logical-pathname-translations "OPENGL")
... | null | https://raw.githubusercontent.com/boxer-project/boxer-sunrise/1ef5d5a65d00298b0d7a01890b3cd15d78adc1af/src/opengl/host.lisp | lisp | rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / host.lisp , v 1.4.15.1 2017/01/19 11:51:03 martin Exp $ " -*- |
Copyright ( c ) 1987 - -2017 LispWorks Ltd. All rights reserved .
(in-package "USER")
(setf (logical-pathname-translations "OPENGL")
`(("**;*" ,(merge-pathnames "**/*" (pathname-location *load-truename*)))))
|
dd1e6e21e038143bb03b070abaef45b4177d95740e383b02624b225a73f46e57 | typelead/eta | tc203.hs | { - # OPTIONS_GHC -fno - warn - redundant - constraints # - }
{-# LANGUAGE RankNTypes #-}
-- Check that we can have a forall after a forall
module Foo4 where
type AnyE a = forall err. Either err a
foo :: Monad m => AnyE (m t)
foo = undefined
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/tc203.hs | haskell | # LANGUAGE RankNTypes #
Check that we can have a forall after a forall | { - # OPTIONS_GHC -fno - warn - redundant - constraints # - }
module Foo4 where
type AnyE a = forall err. Either err a
foo :: Monad m => AnyE (m t)
foo = undefined
|
6acc2173daf9211a166b417f43856de3db5f83d2c4b434db20fb5454499c2f59 | jellelicht/guix | size.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 , 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU 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 t... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/guix/scripts/size.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 , 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (guix scripts size)
#:use-module (guix ui)
#:use-module (guix scripts)
#:use-module (g... |
16880c95f7035984b7d6cabbacb736fd1c150ca642666f741aa402de5732bab3 | mcorbin/tour-of-clojure | fn_nb.clj | (ns tourofclojure.pages.fn-nb
(:require [hiccup.element :refer [link-to]]
[clojure.java.io :as io]
[tourofclojure.pages.util :refer [navigation-block]]))
(def code
(slurp (io/resource "public/pages/code/fn_nb.clj")))
(defn desc
[previous next lang]
(condp = lang
"fr" [:div
... | null | https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/src/tourofclojure/pages/fn_nb.clj | clojure | (ns tourofclojure.pages.fn-nb
(:require [hiccup.element :refer [link-to]]
[clojure.java.io :as io]
[tourofclojure.pages.util :refer [navigation-block]]))
(def code
(slurp (io/resource "public/pages/code/fn_nb.clj")))
(defn desc
[previous next lang]
(condp = lang
"fr" [:div
... | |
d5b0aac3d84420f52ffbbff51afd1248d88987415c69c72a8b0eb4b2d93a31fb | russross/cownfs | nfs_api.ml | Copyright 2004 , 2005
* See the file COPYING for information about licensing and distribution .
* See the file COPYING for information about licensing and distribution. *)
TODO :
- copy on write files should be deleted on operation failure
- rename of directories needs to create / modify .mount ... | null | https://raw.githubusercontent.com/russross/cownfs/cc67fae0294203a78b022d7300be8aa6c35c58af/nfs_api.ml | ocaml | Misc utility functions ****************************************************
let res = Rtypes.uint8_of_int (abs (Util.hashString 0 name)) in
package a Unix stat record for a pre_op_attr result
package a Unix stat record for a post_op_attr result
let print_post_op_attr info =
match info with
| `True i -> ignore... | Copyright 2004 , 2005
* See the file COPYING for information about licensing and distribution .
* See the file COPYING for information about licensing and distribution. *)
TODO :
- copy on write files should be deleted on operation failure
- rename of directories needs to create / modify .mount ... |
3e7091cfec9cd2d30e66d8855529dcfd0a44e253b97e7c59fed5de8b4588082f | facebook/flow | nonvoid_return.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/c0574f1cda8d915edf0402c912b92ed781c16536/src/analysis/env_builder/nonvoid_return.mli | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
e495311249eb1aa38bd5cd8994b782d85e160a9cfa30e4d719778f60a2ba9736 | andersfugmann/ppx_protocol_conv | xml_light.mli | include Protocol_conv.Runtime.Driver with type t = Xml.xml
val of_xml_light_exn: t -> t
val of_xml_light: t -> (t, error) Protocol_conv.Runtime.result
val to_xml_light: t -> t
| null | https://raw.githubusercontent.com/andersfugmann/ppx_protocol_conv/add1548320707df042d64a4c81d3faa3c6cf2475/drivers/xml_light/xml_light.mli | ocaml | include Protocol_conv.Runtime.Driver with type t = Xml.xml
val of_xml_light_exn: t -> t
val of_xml_light: t -> (t, error) Protocol_conv.Runtime.result
val to_xml_light: t -> t
| |
f8356722cb9155867c413cfe4d8b748f3be59c9a2cbba3db05bcc8bd092d291d | chunsj/TH | resnet50.lisp | (defpackage :th.m.resnet50
(:use #:common-lisp
#:mu
#:th)
(:export #:read-resnet50-weights
#:resnet50
#:resnet50fcn))
(in-package :th.m.resnet50)
(defparameter +model-location+ ($concat (namestring (user-homedir-pathname)) ".th/models"))
(defun wfname-txt (wn)
(format nil ... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/m/resnet50.lisp | lisp | (defpackage :th.m.resnet50
(:use #:common-lisp
#:mu
#:th)
(:export #:read-resnet50-weights
#:resnet50
#:resnet50fcn))
(in-package :th.m.resnet50)
(defparameter +model-location+ ($concat (namestring (user-homedir-pathname)) ".th/models"))
(defun wfname-txt (wn)
(format nil ... | |
d371bd1fc4b5810690b624795500675fe6134bc1f5c804a3c598946c045920d3 | haskell/haskell-language-server | PragmaNotAtTopWithCommentsAtTop.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -Wall #
-- another comment
# LANGUAGE TupleSections #
{- some comment -}
class Semigroup a => SomeData a
instance SomeData All
pure -i runghc -p " haskellPackages.ghcWithPackages ( hp : with ; [ turtle ] ) "
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
addOne :... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/fdbc555a9245cb3761c2bf7335f3d18b8cf7673c/plugins/hls-refactor-plugin/test/data/import-placement/PragmaNotAtTopWithCommentsAtTop.hs | haskell | # LANGUAGE OverloadedStrings #
another comment
some comment
# OPTIONS_GHC -Wno-unrecognised-pragmas # |
# OPTIONS_GHC -Wall #
# LANGUAGE TupleSections #
class Semigroup a => SomeData a
instance SomeData All
pure -i runghc -p " haskellPackages.ghcWithPackages ( hp : with ; [ turtle ] ) "
addOne :: Int -> Int
addOne x = x + 1
|
f18f03de277d306c89b37878d8c1b06f159bc1fc7a5ce06f356312adad56e01c | dbuenzli/gg | B0.ml | open B0_kit.V000
(* OCaml library names *)
let b0_std = B0_ocaml.libname "b0.std"
let gg = B0_ocaml.libname "gg"
let gg_top = B0_ocaml.libname "gg.top"
let gg_kit = B0_ocaml.libname "gg.kit"
let str = B0_ocaml.libname "str"
let compiler_libs_toplevel = B0_ocaml.libname "compiler-libs.toplevel"
(* Libraries *)
let... | null | https://raw.githubusercontent.com/dbuenzli/gg/ed822d5d922034c01a43240f5c3c94fa83b6bcb7/B0.ml | ocaml | OCaml library names
Libraries
Tests
N.B. Unless vg is in the build universe, those tests with vg needs
to be build with `-x gg` otherwise we get inconsistent
assumptions. See the also the pgon2_bool_tests pack.
Packs
We use a locked pack so that we compile against the installed gg
otherwise we com... | open B0_kit.V000
let b0_std = B0_ocaml.libname "b0.std"
let gg = B0_ocaml.libname "gg"
let gg_top = B0_ocaml.libname "gg.top"
let gg_kit = B0_ocaml.libname "gg.kit"
let str = B0_ocaml.libname "str"
let compiler_libs_toplevel = B0_ocaml.libname "compiler-libs.toplevel"
let gg_lib =
let srcs = Fpath.[ `File (v "s... |
0a9b7cfce54f400fc9a17448eb22bcef80a31fa17147c336571777343a911ff6 | NorfairKing/declops | Main.hs | module Main where
import Declops
main :: IO ()
main = declopsMain
| null | https://raw.githubusercontent.com/NorfairKing/declops/66c968386ccda5e5d9c6fb09afebb093873bbc8c/declops/app/Main.hs | haskell | module Main where
import Declops
main :: IO ()
main = declopsMain
| |
44bc751669c1a77a54185372c4c86178bc791e71bdea07c9fca68b8ebe24f18f | pirapira/coq2rust | tokens.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/tools/coqdoc/tokens.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Application of printing rules based... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
s Dictionaries : trees annot... |
3787f8c1414075adbe170520cab3596114b63b66f42a7fc4c2dac3f35bf3c8e6 | janestreet/pythonlib | class_wrapper.ml | open Base
open Import
module Id : sig
type t
val create : unit -> t
val to_string : t -> string
end = struct
type t = int
let create =
let current = ref 0 in
fun () ->
Int.incr current;
!current
;;
let to_string = Int.to_string
end
let content_field = "_content"
type 'a t =
{ w... | null | https://raw.githubusercontent.com/janestreet/pythonlib/88a7183f1942c1c7c1f5612489c109aa88855254/src/class_wrapper.ml | ocaml | Do not call the __init__ function when given a capsule as input
as this is used when wrapping values. | open Base
open Import
module Id : sig
type t
val create : unit -> t
val to_string : t -> string
end = struct
type t = int
let create =
let current = ref 0 in
fun () ->
Int.incr current;
!current
;;
let to_string = Int.to_string
end
let content_field = "_content"
type 'a t =
{ w... |
090215a5e54df0a8271a36e8763b21f85a1f0f135afc09633f8d4fa88e4f17fb | karlhof26/gimp-scheme | whitebalance.scm | is a script for The GIMP
;
; Description: converts the color temperature of an image
;
Last changed : 30 July 2022
;
Copyright ( C ) 2006 - 2009 < >
;
With many thanks to < > ,
; from whose grey-point script this is inspired.
;
; --------------------------------------------------------------------
;
... | null | https://raw.githubusercontent.com/karlhof26/gimp-scheme/bd8c74d19772675781f89b3e007d14092653b27a/whitebalance.scm | scheme |
Description: converts the color temperature of an image
from whose grey-point script this is inspired.
--------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
either version 2 of the License , or
(at your option) any later ... | is a script for The GIMP
Last changed : 30 July 2022
Copyright ( C ) 2006 - 2009 < >
With many thanks to < > ,
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundation , Inc. , 675 Mass Ave , Cambridge , , U... |
5323640bfe3187adad7677aafc00eafd5741770f90731586064c1954104f98ca | ghc/packages-Cabal | setup.test.hs | import Test.Cabal.Prelude
import Control.Monad.IO.Class
import Data.Maybe
import System.Directory
-- Test for 'build-type: Configure' example from the setup manual.
main = setupTest $ do
hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
skipUnless hasAutoreconf
_ <- shell "autoreconf" ["-i... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/Configure/setup.test.hs | haskell | Test for 'build-type: Configure' example from the setup manual. | import Test.Cabal.Prelude
import Control.Monad.IO.Class
import Data.Maybe
import System.Directory
main = setupTest $ do
hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
skipUnless hasAutoreconf
_ <- shell "autoreconf" ["-i"]
setup_build []
|
68283621ce4b406ee9f62c3e844e0e91a56e5fa4ed377dde33710027665a1099 | DanielG/kvm-in-a-box | JSON.hs | module JSON where
import Data.Char
import Data.List
import Data.List.Split
import Data.Aeson.TH
GHC staging restriction gah ..
jsonOpts = defaultOptions {
fieldLabelModifier = uncamel . drop 1,
constructorTagModifier = uncamel,
allNullaryToStringTag = True
}
uncam... | null | https://raw.githubusercontent.com/DanielG/kvm-in-a-box/6bf71bb389a19806fac2f32a2c6d92261fb649e1/src/JSON.hs | haskell | module JSON where
import Data.Char
import Data.List
import Data.List.Split
import Data.Aeson.TH
GHC staging restriction gah ..
jsonOpts = defaultOptions {
fieldLabelModifier = uncamel . drop 1,
constructorTagModifier = uncamel,
allNullaryToStringTag = True
}
uncam... | |
5099b960596f5d88733a62fcb2e6077e1d05ca8c8dbbe3293a9aa9f8baefc9b8 | akshaymankar/jsonpath-hs | JSONPathSpec.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Data.JSONPathSpec where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson
import Data.Aeson.Casing
import Data.Aeson.TH
import Data.Aeson.Text
import Data.Bifunctor (Bifunctor (first))... | null | https://raw.githubusercontent.com/akshaymankar/jsonpath-hs/fa7719a62b14e88b3663b6920de16248c4c367b7/test/Data/JSONPathSpec.hs | haskell | # LANGUAGE OverloadedStrings #
| 100 ms
Using '$!' here ensures that the computation is strict, so this can
be timed out properly | # LANGUAGE DeriveGeneric #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Data.JSONPathSpec where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson
import Data.Aeson.Casing
import Data.Aeson.TH
import Data.Aeson.Text
import Data.Bifunctor (Bifunctor (first))
import qualified Data.ByteString.L... |
ba641636c2ad11c095ba71392435c03d43a0bb0664a30b44cdef9bdb3ccde745 | Andromedans/andromeda | context.ml | (** Context with hints. *)
type hint = int * Pattern.ty * Pattern.term * Pattern.term
type entry =
| Variable of Syntax.ty
| Definition of Syntax.ty * Syntax.term
| Equation of hint
| Rewrite of hint
type t = {
decls : entry list ;
names : Syntax.name list
}
let print ?(label="") {decls=ds; names=xs} =
... | null | https://raw.githubusercontent.com/Andromedans/andromeda/a5c678450e6c6d4a7cd5eee1196bde558541b994/archive/old-andromeda/context.ml | ocaml | * Context with hints.
Weaken twice for x and y
x
y
"backwards" because the contexts are stored backwards,
* with the newest variable at the front of the list. |
type hint = int * Pattern.ty * Pattern.term * Pattern.term
type entry =
| Variable of Syntax.ty
| Definition of Syntax.ty * Syntax.term
| Equation of hint
| Rewrite of hint
type t = {
decls : entry list ;
names : Syntax.name list
}
let print ?(label="") {decls=ds; names=xs} =
let rec print_names ds xs... |
f99591ed31cef31ede45916f1402a2064d2e7d5c8d491f3064180d1956847376 | binaryage/chromex | idle.clj | (ns chromex.app.idle
"Use the chrome.idle API to detect when the machine's idle state changes.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps/chromex/app/idle.clj | clojure | -- events -----------------------------------------------------------------------------------------------------------------
docs: /#tapping-events
-- convenience ------------------------------------------------------------------------------------------------------------
--------------------------------------------... | (ns chromex.app.idle
"Use the chrome.idle API to detect when the machine's idle state changes.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper... |
33f435c50e62312721a914fec17965fd51501e1f211b09559d1abcbb57a803ff | haskell-opengl/OpenGLRaw | MeshShader.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.MeshShader
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
----------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/NV/MeshShader.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.NV.MeshShader
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
* Functions | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.NV.MeshShader (
glGetNVMeshShader,
gl_NV_mesh_shader,
pattern GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV,
pattern GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV,
pattern GL_MAX_COMBINED... |
e6d66884f1ef9ea1ef75faf733618185f9be33900c61f663ad21f6838e1ee2c7 | kit-ty-kate/visitors | VisitorsList.ml | let stdlib_compare = compare
open List
(* [last xs] returns the last element of the nonempty list [xs]. *)
let rec last1 x xs =
match xs with
| [] ->
x
| x :: xs ->
last1 x xs
let last xs =
match xs with
| [] ->
assert false
| x :: xs ->
last1 x xs
(* [interval i j] constructs a ... | null | https://raw.githubusercontent.com/kit-ty-kate/visitors/fc53cc486178781e0b1e581eced98e07facb7d29/src/VisitorsList.ml | ocaml | [last xs] returns the last element of the nonempty list [xs].
[interval i j] constructs a list representation of the semi-open interval
[i..j).
[init i j f] constructs a list of the values [f i] up to [f (j - 1)].
Convert [xss] to an array, for speed.
[hextend xs n f] extends the vertical vector [xs] to a m... | let stdlib_compare = compare
open List
let rec last1 x xs =
match xs with
| [] ->
x
| x :: xs ->
last1 x xs
let last xs =
match xs with
| [] ->
assert false
| x :: xs ->
last1 x xs
let rec interval i j : int list =
if i < j then
i :: interval (i + 1) j
else
[]
let ... |
5fec1858840b5a64232952157c4097649e8986b060903a63593c3a27f526bae8 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | RadarReviewResourceSession.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema RadarReviewResourceSession
module StripeAPI.Types.RadarReviewResourceSessio... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/RadarReviewResourceSession.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema RadarReviewResourceSession
| Defines the object schema located at @components.schemas.radar_review_resource_session@ in the specification.
| browser: The browser used in this browser session (e.g., \`Chrome\`).
Co... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.RadarReviewResourceSession where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import ... |
4c79a69599804760e6a24f22371a41a3c30a07df86bb4f04535209fdd5c94acd | mhallin/graphql_ppx | type_utils.ml | open Graphql_ast
open Source_pos
open Schema
type native_type_ref =
| Ntr_named of string
| Ntr_nullable of native_type_ref
| Ntr_list of native_type_ref
let rec to_native_type_ref tr = match tr with
| NonNull (Named n) -> Ntr_named n
| NonNull (List l) -> Ntr_list (to_native_type_ref l)
| NonNull i -> t... | null | https://raw.githubusercontent.com/mhallin/graphql_ppx/5796b3759bdf0d29112f48e43a2f0623f7466e8a/src/base/type_utils.ml | ocaml | open Graphql_ast
open Source_pos
open Schema
type native_type_ref =
| Ntr_named of string
| Ntr_nullable of native_type_ref
| Ntr_list of native_type_ref
let rec to_native_type_ref tr = match tr with
| NonNull (Named n) -> Ntr_named n
| NonNull (List l) -> Ntr_list (to_native_type_ref l)
| NonNull i -> t... | |
7a904956efb78a69760097f7a6b1fe181de680dcc6d5a3450060b4c302e0af8d | cac-t-u-s/om-sharp | bpc.lisp | ;============================================================================
; om#: visual programming language for computer-assisted music composition
;============================================================================
;
; This program is free software. For information on usage
; and redistribution, see... | null | https://raw.githubusercontent.com/cac-t-u-s/om-sharp/195cea724ecb2cecac81d60e86d8ade2086d3ace/src/packages/basic/bpf-bpc/bpc.lisp | lisp | ============================================================================
om#: visual programming language for computer-assisted music composition
============================================================================
This program is free software. For information on usage
and redistribution, see the "... | File author :
(in-package :om)
can be :
(defstruct (tpoint (:include bpfpoint)) time internal-time)
(defun om-make-tpoint (x y &optional time type)
(make-tpoint :x x :y y :time time :internal-time time :type type))
(defmethod om-point-time ((self tpoint)) (tpoint-time self))
(defmethod om-point-time ((s... |
cea979546b4c36e7456ed418ad36f0415f9d39faca6f7de38795666d03feb990 | janestreet/memtrace_viewer_with_deps | node.mli | open Js_of_ocaml
open Base
(** The values associated with an Element and element like nodes.
(that is in practice all nodes that aren't just text). *)
module Element : sig
type t
val tag : t -> string
val attrs : t -> Attrs.t
val key : t -> string option
val with_key : t -> string -> t
val map_attrs ... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/virtual_dom/src/node.mli | ocaml | * The values associated with an Element and element like nodes.
(that is in practice all nodes that aren't just text).
* Same as [inner_html] but for svg elements
* [key] is used by Virtual_dom as a hint during diffing/patching
* Like [create] but for svg nodes (i.e. all to be placed inside <svg> tag). This is
... | open Js_of_ocaml
open Base
module Element : sig
type t
val tag : t -> string
val attrs : t -> Attrs.t
val key : t -> string option
val with_key : t -> string -> t
val map_attrs : t -> f:(Attrs.t -> Attrs.t) -> t
val add_style : t -> Css_gen.t -> t
val add_class : t -> string -> t
end
module Widget :... |
d383851871a0bcaec322e4a15c4b5b148e40f0c27c71433fba72c0046a10f262 | mrDoctorWho/ejabberd_mod_apns | mod_apns.erl | Ejabberd module for the Apple Push Notification Service
%% Created: 07/09/2015 by mrDoctorWho
%% License: MIT/X11
-module(mod_apns).
-author("mrDoctorWho").
-include("ejabberd.hrl").
-include("xmpp.hrl").
-include("mod_apns.hrl").
-include("logger.hrl").
-behaviour(gen_mod).
-record(apns_users, {user :: {binary(... | null | https://raw.githubusercontent.com/mrDoctorWho/ejabberd_mod_apns/d2b5682887540fc1f75e7b9889aac6ddb1431fb7/src/mod_apns.erl | erlang | Created: 07/09/2015 by mrDoctorWho
License: MIT/X11
partially done by uwe-arzt.de
{verify, verify_none}
TODO: Move binary_to_list to create_pair?
Badges?
Record exists, the key is equal to the one we know
Record for this key has been found, but with another token
We don't need the result, but the handler has t... | Ejabberd module for the Apple Push Notification Service
-module(mod_apns).
-author("mrDoctorWho").
-include("ejabberd.hrl").
-include("xmpp.hrl").
-include("mod_apns.hrl").
-include("logger.hrl").
-behaviour(gen_mod).
-record(apns_users, {user :: {binary(), binary()},
token :: binary(),
last_seen :... |
f110723546226a9068d13feb83e890d899e067a9c641633f7b921a460f350101 | gvolpe/shopping-cart-haskell | Cart.hs | # LANGUAGE DeriveAnyClass , DeriveGeneric , OverloadedStrings #
module Domain.Cart where
import Data.Aeson
import Data.Map ( Map )
import Data.UUID ( UUID )
import Database.PostgreSQL.Simple.ToRow
... | null | https://raw.githubusercontent.com/gvolpe/shopping-cart-haskell/303e1dbad6e49f28367c1b54231b333089fc7e13/src/Domain/Cart.hs | haskell | # LANGUAGE DeriveAnyClass , DeriveGeneric , OverloadedStrings #
module Domain.Cart where
import Data.Aeson
import Data.Map ( Map )
import Data.UUID ( UUID )
import Database.PostgreSQL.Simple.ToRow
... | |
73c61ef54576932ffea72c67359616a72908b165ce17bd17bf9ca7c4cde77f0c | rvantonder/hack_parallel | hack_parallel_intf.mli | module Std : sig
module Bucket : sig
(* The general protocol for a next function is to return either Wait (indicating
that workers should wait until more elements are added to the workload), or
Job of a bucket, or Done to indicate there is no more work. *)
type 'a bucket =
| Job of 'a
... | null | https://raw.githubusercontent.com/rvantonder/hack_parallel/c9d0714785adc100345835c1989f7c657e01f629/src/interface/hack_parallel_intf.mli | ocaml | The general protocol for a next function is to return either Wait (indicating
that workers should wait until more elements are added to the workload), or
Job of a bucket, or Done to indicate there is no more work.
Makes a bucket out of a list, without regard for number of workers or the
size of ... | module Std : sig
module Bucket : sig
type 'a bucket =
| Job of 'a
| Wait
| Done
type 'a next =
unit -> 'a bucket
val of_list : 'a list -> 'a list bucket
val make : num_workers:int -> 'a list -> 'a list next
type 'a of_n = { work: 'a; bucket: int; total: int }
val... |
5f07655745c48d4dc557b50820cee577bcc95fd5fde38322b22c80fce8bf0714 | gildor478/ocaml-gettext | gettextLocale_types.ml | (**************************************************************************)
(* ocaml-gettext: a library to translate messages *)
(* *)
Copyright ( C ) 2003 - 2008 < >
(* ... | null | https://raw.githubusercontent.com/gildor478/ocaml-gettext/9b7afc702bccace9a544b8efa2a28bc2b13371ed/src/lib/gettext/extension/gettextLocale_types.ml | ocaml | ************************************************************************
ocaml-gettext: a library to translate messages
This library is free softw... | Copyright ( C ) 2003 - 2008 < >
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version ;
You should have received a copy of the GNU Lesser General Public
License along with this library ; if not ,... |
138e7f3ba33863ba57e71c7c6ad70944e91794231fa0b33f92331bb9fa157fab | simplex-chat/simplexmq | M20220915_connection_queues.hs | # LANGUAGE QuasiQuotes #
module Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220915_connection_queues where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20220915_connection_queues :: Query
m20220915_connection_queues =
[sql|
PRAGMA ignore_check_constraints=ON;
-- rcv_queues
... | null | https://raw.githubusercontent.com/simplex-chat/simplexmq/8f9e6c2112c21cba3a29889d0fce3b161f137a76/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20220915_connection_queues.hs | haskell | rcv_queues
snd_queues
connections
messages | # LANGUAGE QuasiQuotes #
module Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220915_connection_queues where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20220915_connection_queues :: Query
m20220915_connection_queues =
[sql|
PRAGMA ignore_check_constraints=ON;
ALTER TABLE rc... |
068a9ef5fd7697cde72f26679857f5739f4a1a97de5f2a108ec1c52b5209b3c5 | tonyrog/edrone | edrone_control.erl | %%%-------------------------------------------------------------------
@author magnus < magnus@t520 >
( C ) 2013 , magnus
%%% @doc
%%%
%%% @end
Created : 24 Sep 2013 by magnus < magnus@t520 >
%%%-------------------------------------------------------------------
-module(edrone_control).
-behaviour(gen_server).
... | null | https://raw.githubusercontent.com/tonyrog/edrone/ca8d2e2da75b064619697a1f4e53584051c23fca/src/edrone_control.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
gen_server callbacks
SET THIS VALUE TO -1 FOR GLITCH FREE OPERATION
SET THIS VALUE TO 0 FOR GLITCHY OPERATION
0 = glitchy. -1 = not glitchy
-define(HAVE_GLITCH, ... | @author magnus < magnus@t520 >
( C ) 2013 , magnus
Created : 24 Sep 2013 by magnus < magnus@t520 >
-module(edrone_control).
-behaviour(gen_server).
-export([start_link/0]).
-include("nav.hrl").
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-export([flat_trim/0,... |
5df6d834cafe1c464857a7c82c4a7ec789322318c7578b8275cb03fd34e5af36 | adam-james-v/svg-clj | layout.cljc | (ns svg-clj.layout
"Provides functions for layout control of elements."
(:require [svg-clj.elements :as el]
[svg-clj.transforms :as tf]
[svg-clj.utils :as u]))
(defn distribute-linear
"Distribute `elems` along the `axis` (either :x or :y) with a `gap` distance between each item."
[elems... | null | https://raw.githubusercontent.com/adam-james-v/svg-clj/4220d7036113564a2af84a61d8f7db486ce858da/src/svg_clj/layout.cljc | clojure | (ns svg-clj.layout
"Provides functions for layout control of elements."
(:require [svg-clj.elements :as el]
[svg-clj.transforms :as tf]
[svg-clj.utils :as u]))
(defn distribute-linear
"Distribute `elems` along the `axis` (either :x or :y) with a `gap` distance between each item."
[elems... | |
945e771081b094d105bc802db01191061170f692b5fe9144bd8d0ea60e12b7b0 | icfpcontest2021/icfpcontest2021.github.io | Slope.hs | # LANGUAGE DeriveFunctor #
module BrainWall.Edge.Slope
( Slope (..)
, fromV2
, between
) where
import BrainWall.V2
import Data.Ratio (Ratio, (%))
-- | Slope is an infinite precision representation of an angle. It works
by storing the slope of the line in a " Quadrant " .
--
... | null | https://raw.githubusercontent.com/icfpcontest2021/icfpcontest2021.github.io/fb23fea2a8ecec7740017d3dda78d921c1df5a26/toolchain/lib/BrainWall/Edge/Slope.hs | haskell | | Slope is an infinite precision representation of an angle. It works
Q3 | Q4
----+----
Q2 | Q1
| # LANGUAGE DeriveFunctor #
module BrainWall.Edge.Slope
( Slope (..)
, fromV2
, between
) where
import BrainWall.V2
import Data.Ratio (Ratio, (%))
by storing the slope of the line in a " Quadrant " .
The constructors of this datatype are designed to have a good ' ' instance... |
14158a2397f58e64e106c66f521039af47097f7bd20f8d7de43bb8407a098eec | mirage/bechamel | s.mli | module type FUNCTOR = sig
type 'a t
end
module type MEASURE = sig
type witness
val label : witness -> string
val unit : witness -> string
val make : unit -> witness
val load : witness -> unit
val unload : witness -> unit
val get : witness -> float
end
| null | https://raw.githubusercontent.com/mirage/bechamel/7a0aebef3c2ec266db97385264be74274bdc4765/lib/s.mli | ocaml | module type FUNCTOR = sig
type 'a t
end
module type MEASURE = sig
type witness
val label : witness -> string
val unit : witness -> string
val make : unit -> witness
val load : witness -> unit
val unload : witness -> unit
val get : witness -> float
end
| |
34ad2a8bae0a6584e054a16c770f61a46de9a0ad73954355a083c67d677c47f6 | gebi/jungerl | memcached.erl | %%%-------------------------------------------------------------------
%%% File : memcached.erl
Author : < >
Description : memcached client for Erlang
Protocol described here :
%%%
Created : 20 Sep 2007 by < >
%%%-------------------------------------------------------------------
-module(memcached... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/memcached/src/memcached.erl | erlang | -------------------------------------------------------------------
File : memcached.erl
-------------------------------------------------------------------
API
gen_server callbacks
====================================================================
API
=========================================================... | Author : < >
Description : memcached client for Erlang
Protocol described here :
Created : 20 Sep 2007 by < >
-module(memcached).
-behaviour(gen_server).
-export([start_link/2, mcset/3, mcset/5, mcget/2, mcdelete/3, mcdelete/2, mcquit/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info... |
80cbdd7e39059d4dd349c05e3c08f25443ffcbcdc29394b23203f1d54042712e | russ/openpoker | observer.erl | Copyright ( C ) 2005 - 2008 Wager Labs , SA
%%%%
%%%% THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
CREATIVE COMMONS PUBLIC LICENSE ( " CCPL " OR " LICENSE " ) . THE WORK IS
%%%% PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF
%%%% THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICE... | null | https://raw.githubusercontent.com/russ/openpoker/62edd72a35b9ef52f55da9303cf1e06142e95895/src/observer.erl | erlang |
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF
THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT
LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT
AND AGREE TO BE BOUND BY THE TERM... | Copyright ( C ) 2005 - 2008 Wager Labs , SA
CREATIVE COMMONS PUBLIC LICENSE ( " CCPL " OR " LICENSE " ) . THE WORK IS
-nc-sa/3.0/us/
-module(observer).
-export([start/1, stop/1, observe/2]).
-include("common.hrl").
-include("bot.hrl").
-include("pp.hrl").
-record(obs, {
id,
trace,
... |
c66c49b43d8ce846822c4925597a3577e6124086297caad0c7546c2a9f6847ca | marcoonroad/shared-secret | shared_secret.ml | module type IMessage = sig
type t
type a
module Encoder : sig val encode : a -> t end;;
module Decoder : sig val decode : t -> a end;;
end;;
module Message (Type : sig type t end) ( ) : (IMessage with type a := Type.t) = struct
type t = Type.t
module Encoder = struct let encode msg = msg end;;
module D... | null | https://raw.githubusercontent.com/marcoonroad/shared-secret/26cc28c17ecdefe3991f9f4a899af6ab645817e4/lib/shared_secret.ml | ocaml | END | module type IMessage = sig
type t
type a
module Encoder : sig val encode : a -> t end;;
module Decoder : sig val decode : t -> a end;;
end;;
module Message (Type : sig type t end) ( ) : (IMessage with type a := Type.t) = struct
type t = Type.t
module Encoder = struct let encode msg = msg end;;
module D... |
7150083ac8ab9659fddb9c1b8fef03a8ba4b90f54f5d9dc8101cc3540a3f2494 | Gopiandcode/guile-ocaml | guile.ml |
GNU ( C ) 2021
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the h... | null | https://raw.githubusercontent.com/Gopiandcode/guile-ocaml/247adf5a6adbbfd85696498b390167a9faa77779/lib/guile.ml | ocaml |
GNU ( C ) 2021
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the h... | |
f5c300120011fe89fa188f4aadff7202e02845e85ccee9b1c9a9e294ad973103 | mck-/Open-VRP | greedy-best-insertion.lisp | ;;; Greedy Best Insertion heuristic
;;; -------
Using a ( random ) sequence , insert the < Nodes > one by one in the best feasible < vehicle >
;;; and at the optimal location in its route. Used as a feasible initial solution to the
Tabu Search . Randomizing the sequence assures a broad search space when using mult... | null | https://raw.githubusercontent.com/mck-/Open-VRP/408cb67063474ab61ddfc1631b5ac39714f2535e/algo/greedy-best-insertion.lisp | lisp | Greedy Best Insertion heuristic
-------
and at the optimal location in its route. Used as a feasible initial solution to the | Using a ( random ) sequence , insert the < Nodes > one by one in the best feasible < vehicle >
Tabu Search . Randomizing the sequence assures a broad search space when using multi - run
(in-package :open-vrp.algo)
(defclass greedy-best-insertion (algo)
((name :initform "Greedy Best Insertion heuristic")
(des... |
86b3f52be8096b74949df5f4f83974749d577515fc1f63d1820da8f2ca869736 | music-suite/music-suite | MusicXml.hs | # OPTIONS_GHC -fno - warn - dodgy - exports #
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-- |
Copyright : ( c ) 2012
--
-- License : BSD-style
--
Maintainer :
-- Stability ... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Data/Music/MusicXml.hs | haskell | -----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
|
License : BSD-style
Stability : experimental
Portability : portable
For an introduction to MusicXML, see <>.
* Score
** Part list
*... | # OPTIONS_GHC -fno - warn - dodgy - exports #
Copyright : ( c ) 2012
Maintainer :
A representation of MusicXML 3.0 .
You may want to use the " Data . Music . MusicXml . Simple " module to generate the representation .
module Data.Music.MusicXml
Score (..),
ScoreHeader (..),
Identificatio... |
5ffc864b16ec6dcc33333da5abeb8d742fd56a5d0dab742384ed0f5087472d15 | facebook/infer | Mangled.mli |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... | null | https://raw.githubusercontent.com/facebook/infer/4ee1c2a8e783ee770b61547a38ff1715d6ed75fe/infer/src/IR/Mangled.mli | ocaml | * Module for Mangled Names
* Type of mangled names
* Equality for mangled names
* Convert a string to a mangled name
* Create a mangled name from a plain and mangled string
* Convert a mangled name to a string
* Convert a full mangled name to a string
* Pretty print a mangled name
* Set of Mangled.
* Map with ... |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... |
3865ffa8476987c5ebcaa20f016dde99b73235386c84c17556fa86d3173d6e63 | emqx/minirest | minirest_handler.erl | Copyright ( c ) 2013 - 2022 EMQ Technologies Co. , Ltd. 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
%%
%% -2.0
%%
%% Unless required by applicable law... | null | https://raw.githubusercontent.com/emqx/minirest/0203dfb0e0e196754753578659cd2b4e1a95fc2b/src/minirest_handler.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2013 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(minirest_handler).
-export([init/2]).
-include("minirest_http.hrl").
-include("minire... |
4454d5e4a9d0ed50d18386e493fcc94d61486fde8feb2342c2f12fbe0c152d98 | graninas/Functional-Design-and-Architecture | Language.hs | {-# LANGUAGE GADTs #-}
module Andromeda.LogicControl.Language where
import Andromeda.Hardware.Domain
import Andromeda.LogicControl.Domain
import Andromeda.Common.Value
import qualified Andromeda.Hardware.Language.Hdl as L
import qualified Andromeda.Hardware.Language.DeviceControl as L
import Control.Monad.Free (Fre... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/faee58404e7d766c6c21f1ffdf9a2e792aebb4cb/Second-Edition-Manning-Publications/BookSamples/CH06/Section6p1p1/src/Andromeda/LogicControl/Language.hs | haskell | # LANGUAGE GADTs # |
module Andromeda.LogicControl.Language where
import Andromeda.Hardware.Domain
import Andromeda.LogicControl.Domain
import Andromeda.Common.Value
import qualified Andromeda.Hardware.Language.Hdl as L
import qualified Andromeda.Hardware.Language.DeviceControl as L
import Control.Monad.Free (Free, liftF)
data LogicC... |
8a96b94151e54a7c25803e6e729ac0efeb455cfac4cd979f8ffecb3611bf4764 | clf/lollimon | mylexer.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, proje... | null | https://raw.githubusercontent.com/clf/lollimon/bc4290f5bb221c514b2a66ec427e85eec498c7be/src/mylexer.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
* * *
significantly modified by an... |
a802d3d393cf3dbbca8fa9023afe0a02613e038b6bf76031208cbf9865465882 | ghl3/dataframe | core.clj | (ns dataframe.core
(:refer-clojure :exclude [group-by])
(:require [dataframe.series]
[dataframe.frame])
(:import (dataframe.series Series)
(dataframe.frame Frame)))
; Multi Methods
(defn delegate
"Deligate the implementation of a multimethod to an existing function"
[multifn dispatch... | null | https://raw.githubusercontent.com/ghl3/dataframe/31212c14669e31797ec13cde650a61fd97dbe6d2/src/dataframe/core.clj | clojure | Multi Methods
Imported series methods
Imported frame methods | (ns dataframe.core
(:refer-clojure :exclude [group-by])
(:require [dataframe.series]
[dataframe.frame])
(:import (dataframe.series Series)
(dataframe.frame Frame)))
(defn delegate
"Deligate the implementation of a multimethod to an existing function"
[multifn dispatch-val f]
(.. mu... |
d36ee0055f635686d90b6ac7e2f33736582822a154c4a18152112460484fd993 | heliaxdev/extensible-data | Param.hs | import ParamBase
import Extensible
data With a
do an <- newName "a"
let a = varT an
extendT "T" [an] [t|With $a|] $ defaultExtT {
typeTX = [("Extra", [a])]
}
main :: IO ()
main = pure ()
| null | https://raw.githubusercontent.com/heliaxdev/extensible-data/d11dee6006169cb537e95af28c3541a24194dea8/examples/param/Param.hs | haskell | import ParamBase
import Extensible
data With a
do an <- newName "a"
let a = varT an
extendT "T" [an] [t|With $a|] $ defaultExtT {
typeTX = [("Extra", [a])]
}
main :: IO ()
main = pure ()
| |
8db3512fda251311b2ea02879b75a8a3b4b04ff21190abc5bbebb445fd134e8e | ewestern/geos | Main.hs | # LANGUAGE ScopedTypeVariables #
module Main where
import Test.Hspec
import Data.Geometry.Geos.TopologySpec
import Data.Geometry.Geos.RelatableSpec
import Data.Geometry.Geos.SerializeSpec
import Data.Geometry.Geos.STRTreeSpec
main :: IO ()
main = hspec $ do
topologySpec
relatableSpec
serializeSpec
strSpec
| null | https://raw.githubusercontent.com/ewestern/geos/3568c3449efe180bd89959c9247d4667137662b6/tests/Main.hs | haskell | # LANGUAGE ScopedTypeVariables #
module Main where
import Test.Hspec
import Data.Geometry.Geos.TopologySpec
import Data.Geometry.Geos.RelatableSpec
import Data.Geometry.Geos.SerializeSpec
import Data.Geometry.Geos.STRTreeSpec
main :: IO ()
main = hspec $ do
topologySpec
relatableSpec
serializeSpec
strSpec
| |
88ae2c483734bb51c6da1a70ba668000d2ca955cb8b50e309d1df4e5a466c2d1 | ocaml/merlin | expansion.ml | open Std
type t = Trie of (string * Longident.t * t list lazy_t)
let rec explore_node lident env =
let add_module name _ _ l =
let lident = Longident.Ldot (lident, name) in
Trie (name, lident, lazy (explore_node lident env)) :: l
in
Env.fold_modules add_module (Some lident) env []
let explore ?(global_... | null | https://raw.githubusercontent.com/ocaml/merlin/e576bc75f11323ec8489d2e58a701264f5a7fe0e/src/analysis/expansion.ml | ocaml | distance vectors (v0=previous, v1=current)
initialize v0: v0(i) = A(0)(i) = delete i chars from t
main loop for the bottom up dynamic algorithm
first edit distance is the deletion of i+1 elements from s
try add/delete/replace operations
copy v1 into v0 for next iteration | open Std
type t = Trie of (string * Longident.t * t list lazy_t)
let rec explore_node lident env =
let add_module name _ _ l =
let lident = Longident.Ldot (lident, name) in
Trie (name, lident, lazy (explore_node lident env)) :: l
in
Env.fold_modules add_module (Some lident) env []
let explore ?(global_... |
915b7ca277ca2bf2004c2c79fd670ee0a8db948b0442f4c4e30f876059530c3a | the-dr-lazy/cascade | Prelude.hs | |
Module : Cascade . Api . Test . Prelude
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCRIPTION ! ! ! ... | null | https://raw.githubusercontent.com/the-dr-lazy/cascade/014a5589a2763ce373e8c84a211cddc479872b44/cascade-api/test/Cascade/Api/Test/Prelude.hs | haskell | |
Module : Cascade . Api . Test . Prelude
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCRIPTION ! ! ! ... | |
94cb2e92de04317154f7cba0217b71e6d951b6cbed7783b079c4d8644bd7cc4d | bdeket/rktsicm | ghelper.rkt | #lang racket/base
(require (for-syntax racket/base)
rackunit
"../../kernel/cstm/ghelper.rkt")
(define (any? _) #t)
(define (nvr? _) #f)
(define-syntax (test-it1 stx)
(syntax-case stx ()
[(_ make-generic-operator)
#'(test-case
"foo"
(define (foo-default x y z) 'foo-default)
... | null | https://raw.githubusercontent.com/bdeket/rktsicm/225a43bc3d9953f9dbbdbfb2fa4a50028a7a41ce/rktsicm/sicm/tests/kernel/ghelper.rkt | racket | ^^ this is different from ghelper-class (in in line with scmutils): rest args are not checked
in practice it seems the #:rest is only ever used for the top tree (which doesn't have a pred?) | #lang racket/base
(require (for-syntax racket/base)
rackunit
"../../kernel/cstm/ghelper.rkt")
(define (any? _) #t)
(define (nvr? _) #f)
(define-syntax (test-it1 stx)
(syntax-case stx ()
[(_ make-generic-operator)
#'(test-case
"foo"
(define (foo-default x y z) 'foo-default)
... |
7bd80d40d09c10f35149aa4fcf7d9ff27b136e1eb7e70521fbe17a1042890f06 | LeventErkok/sbv | Deduce.hs | -----------------------------------------------------------------------------
-- |
Module : Documentation . SBV.Examples . Uninterpreted . Deduce
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Demonstrates uninterpreted sorts and how they can be used for deduction.
-- ... | null | https://raw.githubusercontent.com/LeventErkok/sbv/be4d7260187067a71ef8af18006e74698e2a565b/Documentation/SBV/Examples/Uninterpreted/Deduce.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Maintainer:
Stability : experimental
Demonstrates uninterpreted sorts and how they can be used for deduction.
This example is inspired by the discussion at <-axioms-for-deductions-in-z3>,
-----------------------------... | Module : Documentation . SBV.Examples . Uninterpreted . Deduce
Copyright : ( c )
essentially showing how to show the required deduction using SBV .
# LANGUAGE StandaloneDeriving #
module Documentation.SBV.Examples.Uninterpreted.Deduce where
import Data.SBV
to not / or / and , so hide their Prelude co... |
67904de57e48c4bba880cfa9bd6862a2fa5f699b19916dbffbd833841a8be95b | haskell-gi/haskell-gi | DBusServersInfo.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Definitions of the D-Bus method servers to be installed by the
-- browser and the extension.
module DBusServersInfo
( extensionServerInfo
, browserServerInfo
) where
import DBusHelpers (DBusServerInfo(..))
-- | Definition of the method server installed by the extension.
... | null | https://raw.githubusercontent.com/haskell-gi/haskell-gi/bff8f3b92bf2594ea3d6745c346a8de594fc3709/examples/WebKit/DBusServersInfo.hs | haskell | # LANGUAGE OverloadedStrings #
| Definitions of the D-Bus method servers to be installed by the
browser and the extension.
| Definition of the method server installed by the extension.
| Definition of the D-Bus server to be installed by the browser. |
module DBusServersInfo
( extensionServerInfo
, browserServerInfo
) where
import DBusHelpers (DBusServerInfo(..))
extensionServerInfo :: DBusServerInfo
extensionServerInfo = DBusServerInfo {
serverBusName = "haskellGI.test.simpleExtension",
serverXMLInfo = xml,
serverInterfaceName = "tes... |
e3ac438bb050422340d07c23bb9c3843bb2d0946d247751dfbf511f081e7e7da | Tyruiop/syncretism | db.clj | (ns syncretism.crawler.db
(:require
[clojure.string :as str]
[next.jdbc :as jdbc]
[next.jdbc.prepare :as jdbp]
[next.jdbc.types :as jdbt]))
(def db (-> "resources/db.edn" slurp read-string))
(def fundamentals-table-def
"create table if not exists fundamentals (
symbol VARCHAR(10) primary key not null,... | null | https://raw.githubusercontent.com/Tyruiop/syncretism/841b5c1d74511684f027c9d14eb18a761d8c0276/syncretism-crawler/src/syncretism/crawler/db.clj | clojure | ")
")
")
(jdbc/execute! db ["ALTER TABLE live ADD COLUMN (breakeven FLOAT)"])
(jdbc/execute! db ["ALTER TABLE live ADD COLUMN (delta FLOAT)"])
(jdbc/execute! db ["ALTER TABLE live ADD COLUMN (gamma FLOAT)"])
(jdbc/execute! db ["ALTER TABLE live ADD COLUMN (rho FLOAT)"])
(jdbc/execute! db ["ALTER TABLE live ADD COL... | (ns syncretism.crawler.db
(:require
[clojure.string :as str]
[next.jdbc :as jdbc]
[next.jdbc.prepare :as jdbp]
[next.jdbc.types :as jdbt]))
(def db (-> "resources/db.edn" slurp read-string))
(def fundamentals-table-def
"create table if not exists fundamentals (
symbol VARCHAR(10) primary key not null,... |
dffe0a1c5f6531c4501c07e1d8d0ec69e6dc7509b70c10c28d942eb3886a7c2a | Chase-C/Flocking-Simulation | Octree.hs | module Octree where
---------------------------------------------------------
import Control.Applicative
import Data.Bits
import qualified Data.List as L
import Linear
import Boid
---------------------------------------------------------
data Octree = Node
{ center :: V3 Float
... | null | https://raw.githubusercontent.com/Chase-C/Flocking-Simulation/897ee7adbe2cd7ae27faf37d65c41e6c2d189b0c/src/Octree.hs | haskell | -------------------------------------------------------
-------------------------------------------------------
front, back, top, bottom, right, left
-------------------------------------------------------
-------------------------------------------------------
-------------------------------------------------------
-... | module Octree where
import Control.Applicative
import Data.Bits
import qualified Data.List as L
import Linear
import Boid
data Octree = Node
{ center :: V3 Float
, len :: Float
, count :: Int
, ftr, ftl, fbr, fbl, btr, btl, bbr, bbl :: Oc... |
93d03708a22a51b01a228d0bf5f4b566da27a7ce5131a6a27c824facad9c7f37 | bcc32/advent-of-code | main.ml | open! Core
open! Async
let () = Command.run P13.Main.game_command
| null | https://raw.githubusercontent.com/bcc32/advent-of-code/653c0f130e2fb2f599d4e76804e02af54c9bb19f/2019/13/bin/main.ml | ocaml | open! Core
open! Async
let () = Command.run P13.Main.game_command
| |
b3565c90d701d62306bd1e5ef80a47afcc12107acb2e4ac2cc605cb6b86d0ede | REPROSEC/dolev-yao-star | Spec_P256_Lemmas.ml | open Prims
let rec (pow : Prims.nat -> Prims.nat -> Prims.nat) =
fun a ->
fun b ->
if b = Prims.int_zero
then Prims.int_one
else a * (pow a (b - Prims.int_one))
type 'n elem = Prims.nat
let (fmul : Prims.pos -> unit elem -> unit elem -> unit elem) =
fun n -> fun x -> fun y -> (x * y) ... | null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Spec_P256_Lemmas.ml | ocaml | open Prims
let rec (pow : Prims.nat -> Prims.nat -> Prims.nat) =
fun a ->
fun b ->
if b = Prims.int_zero
then Prims.int_one
else a * (pow a (b - Prims.int_one))
type 'n elem = Prims.nat
let (fmul : Prims.pos -> unit elem -> unit elem -> unit elem) =
fun n -> fun x -> fun y -> (x * y) ... | |
c7b029c19aeb9d5af55894bebfb265a25ccab605688290fa6ff4ea82f981a33b | janestreet/core_extended | shared.ml | open Core
the maximum read / write I managed to get off of a socket or disk was 65k
let buffer_size = 10 * 65 * 1024
type ('a, 'b) reader =
?strip:bool
-> ?skip_lines:int
-> ?on_parse_error:
[ `Raise | `Handle of string Queue.t -> exn -> [ `Continue | `Finish ] ]
-> header:'a
-> 'b
let strip_buffe... | null | https://raw.githubusercontent.com/janestreet/core_extended/5eb206493891be4610ed188c0ac44006a5b72061/delimited_kernel/src/shared.ml | ocaml | already set above | open Core
the maximum read / write I managed to get off of a socket or disk was 65k
let buffer_size = 10 * 65 * 1024
type ('a, 'b) reader =
?strip:bool
-> ?skip_lines:int
-> ?on_parse_error:
[ `Raise | `Handle of string Queue.t -> exn -> [ `Continue | `Finish ] ]
-> header:'a
-> 'b
let strip_buffe... |
ccbde1a92e54ec832e162c725712caa510710c414fac26498af7142f115f16b2 | tarides/opam-monorepo | test_uri_utils.ml | module Normalized = Duniverse_lib.Uri_utils.Normalized
let test_canonical_uri =
let make_test ~supplied:(a, b) ~expected =
let a = Uri.of_string a in
let a' = Normalized.of_uri a in
let b = Uri.of_string b in
let b' = Normalized.of_uri b in
let test_name = Fmt.str "Comparing %a and %a" Uri.pp a U... | null | https://raw.githubusercontent.com/tarides/opam-monorepo/5557a3253aa3e032418fb0bff4830e203ab87ae6/test/lib/test_uri_utils.ml | ocaml | module Normalized = Duniverse_lib.Uri_utils.Normalized
let test_canonical_uri =
let make_test ~supplied:(a, b) ~expected =
let a = Uri.of_string a in
let a' = Normalized.of_uri a in
let b = Uri.of_string b in
let b' = Normalized.of_uri b in
let test_name = Fmt.str "Comparing %a and %a" Uri.pp a U... | |
09af1af01adc2172426fba79c133b8472157c619c58c29c257b49dee66ce81a8 | lem-project/lem | syntax-table.lisp | (defpackage :lem-lisp-syntax.syntax-table
(:use :cl :lem-base)
(:export :*syntax-table*)
#+sbcl
(:lock t))
(in-package :lem-lisp-syntax.syntax-table)
(flet ((f (c1 c2 step-fn)
(when c1
(when (and (member c1 '(#\#))
(or (alphanumericp c2)
(memb... | null | https://raw.githubusercontent.com/lem-project/lem/a17b56e415eb7a94fa3653800b9fea7ae59f664c/lib/lisp-syntax/syntax-table.lisp | lisp | (defpackage :lem-lisp-syntax.syntax-table
(:use :cl :lem-base)
(:export :*syntax-table*)
#+sbcl
(:lock t))
(in-package :lem-lisp-syntax.syntax-table)
(flet ((f (c1 c2 step-fn)
(when c1
(when (and (member c1 '(#\#))
(or (alphanumericp c2)
(memb... | |
c6cedc9b14ab3d1475c24ddd3aeaf44d2a8bb22faa171a8e7c634c1da19a2dbe | ageneau/ecl-android | package.lisp | (in-package :cl-user)
(defpackage :openglsample
(:use :cl :cl-opengl)
(:export
#:shader-vao-window
#:setup
#:tick
#:display
#:reshape
#:cleanup))
| null | https://raw.githubusercontent.com/ageneau/ecl-android/324180b7701eaa24228d8602fafe7c040c976867/iOS/OpenGLSample/OpenGLSample/Lisp/package.lisp | lisp | (in-package :cl-user)
(defpackage :openglsample
(:use :cl :cl-opengl)
(:export
#:shader-vao-window
#:setup
#:tick
#:display
#:reshape
#:cleanup))
| |
ce02ede7faf94020a7ff2383595407c71193c54aa14d3fb814ca73339e3b6e6d | rescript-lang/rescript-editor-support | Files.ml | let split str string = Str.split (Str.regexp_string str) string
let removeExtraDots path =
Str.global_replace (Str.regexp_string "/./") "/" path
|> Str.global_replace (Str.regexp {|^\./\.\./|}) "../"
(* Win32 & MacOS are case-insensitive *)
let pathEq =
match Sys.os_type = "Linux" with
| true -> fun a b -> a ... | null | https://raw.githubusercontent.com/rescript-lang/rescript-editor-support/abc79068861c2a4811e8ce2072908167bd7fbf25/src/Files.ml | ocaml | Win32 & MacOS are case-insensitive
windows can't use open_in | let split str string = Str.split (Str.regexp_string str) string
let removeExtraDots path =
Str.global_replace (Str.regexp_string "/./") "/" path
|> Str.global_replace (Str.regexp {|^\./\.\./|}) "../"
let pathEq =
match Sys.os_type = "Linux" with
| true -> fun a b -> a = b
| false -> fun a b -> String.lowerc... |
7f96b4c5fa3ed27117aa442fbeb9e12d5bfb432fe4de5fce151232a5128fd46a | EarnestResearch/honeycomb-haskell | Api.hs | -- |
-- Module : Honeycomb.Api
-- Description : API access library for @honeycomb.io@
Copyright : ( c ) 2019 - 2020 Earnest Research
-- License : Apache-2
-- Maintainer :
-- Stability : alpha
-- Portability : POSIX
--
-- The "Honeycomb.Api" module provides a very low-level method of accessing
the Ho... | null | https://raw.githubusercontent.com/EarnestResearch/honeycomb-haskell/0cb643a637e1b23eecded845970e6a973f8385cf/honeycomb/src/Honeycomb/Api.hs | haskell | |
Module : Honeycomb.Api
Description : API access library for @honeycomb.io@
License : Apache-2
Maintainer :
Stability : alpha
Portability : POSIX
The "Honeycomb.Api" module provides a very low-level method of accessing
servers (with limited support for retrying on timeout). | Copyright : ( c ) 2019 - 2020 Earnest Research
the Honeycomb API . Each call represents a direct request to the Honeycomb
module Honeycomb.Api
( module Honeycomb.Api.Events,
module Honeycomb.Api.Types,
)
where
import Honeycomb.Api.Events
import Honeycomb.Api.Types
|
0abdde3537df6ccf66cc5959a62bfe8a737798b2ffcaeb6d434abd10890117ee | arttuka/reagent-material-ui | oil_barrel_sharp.cljs | (ns reagent-mui.icons.oil-barrel-sharp
"Imports @mui/icons-material/OilBarrelSharp as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def oil-barrel-sharp (create-... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/oil_barrel_sharp.cljs | clojure | (ns reagent-mui.icons.oil-barrel-sharp
"Imports @mui/icons-material/OilBarrelSharp as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def oil-barrel-sharp (create-... | |
ec2d9fca583fb9d16fc30a062b1bdfd740784dceff15050dc94e7472412199ce | pascal-knodel/haskell-craft | E'5'19.hs | --
--
--
-----------------
Exercise 5.19 .
-----------------
--
--
--
module E'5'19 where
import Prelude hiding ( toUpper , isLower )
import qualified Data.Char ( toUpper , isLower )
-- To implement capitalize we could reuse solutions from earlier exercises ...
Exercise 3.16 ( solution of it ) .
upperLo... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'5'19.hs | haskell |
---------------
---------------
To implement capitalize we could reuse solutions from earlier exercises ...
...
Other solutions for "capitalize" and "capitalizeLetters": | Exercise 5.19 .
module E'5'19 where
import Prelude hiding ( toUpper , isLower )
import qualified Data.Char ( toUpper , isLower )
Exercise 3.16 ( solution of it ) .
upperLowerCaseOffset :: Int
upperLowerCaseOffset = (fromEnum 'a') - (fromEnum 'A')
isLower :: Char -> Bool
isLower aChar
| (aChar ... |
184d404128a32bd5a40e2fd9df8889a28c127396501938ddc195775f3af8b4d5 | alanz/ghc-exactprint | proc-do-complex.hs | {-# LANGUAGE Arrows #-}
foo
f
g
h
ma = proc (
(a, b),
(c, d),
(e, f)
) ->
do -- Begin do
GHC parser fails if layed out over multiple lines
<- f -- Call into f
(a,
c) -- Tuple together arguments
(b,
d)
... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/103bc706c82300639985a15ba6cf762316352c92/tests/examples/ghc92/proc-do-complex.hs | haskell | # LANGUAGE Arrows #
Begin do
Call into f
Tuple together arguments
Funnel into arrow
Basic condition
Only left case is relevant
Actually never used
Just do the calculation
Let bindings bind expressions, not commands
Could pattern match directly on x
Sometimes execute effects
Just do the calculation | foo
f
g
h
ma = proc (
(a, b),
(c, d),
(e, f)
) ->
GHC parser fails if layed out over multiple lines
(a,
(b,
d)
d * b)
if
of Left (z,
Procs can have lambdas
let
v
... |
c95d0b5adcf3ed1e86193505d804e637ea607ba0d1f8861470b5c45708c4be8e | graninas/Pragmatic-Type-Level-Design | Types.hs | module HCell.Gloss.Types where
import CPrelude
import HCell.Types
-- X is horizontal, grows to right
-- Y is vertical, grows to up
-- (-x, -y) is the left bottom corner
-- (0, 0) is in the center of the window
newtype GlossCoords = GlossCoords (Float, Float)
Moves ( 0 , 0 ) to the left down corner
newtype Gl... | null | https://raw.githubusercontent.com/graninas/Pragmatic-Type-Level-Design/a95f9a5d7ae5b443b9d8ef77b27f1aecf02f461a/demo-apps/hcell/src/HCell/Gloss/Types.hs | haskell | X is horizontal, grows to right
Y is vertical, grows to up
(-x, -y) is the left bottom corner
(0, 0) is in the center of the window | module HCell.Gloss.Types where
import CPrelude
import HCell.Types
newtype GlossCoords = GlossCoords (Float, Float)
Moves ( 0 , 0 ) to the left down corner
newtype GlossBaseShift = GlossBaseShift (Float, Float)
newtype GlossWindowSize = GlossWindowSize Coords
newtype GlossWindowPosition = GlossWindowPositio... |
c9811b6d1f0bf5fa8abcdba7d3eadaedf721dc9f65f958a5c2d99960860d5c5d | kanatohodets/riak_core_workshop_euc2016 | kvapi_app.erl | %%%-------------------------------------------------------------------
%% @doc kvapi public API
%% @end
%%%-------------------------------------------------------------------
-module(kvapi_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%%=========================================... | null | https://raw.githubusercontent.com/kanatohodets/riak_core_workshop_euc2016/a396bb5a1879ec0cb3d70bbc4b6cd39e097cd610/5_http_kv/erlang/apps/kvapi/src/kvapi_app.erl | erlang | -------------------------------------------------------------------
@doc kvapi public API
@end
-------------------------------------------------------------------
Application callbacks
====================================================================
API
==========================================================... |
-module(kvapi_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
Dispatch = cowboy_router:compile([
{'_', [{"/api/store/:key", kvapi_handler, []}]}
]),
cowboy:start_http(kvapi_http_listener, 100, [{port, 4000}],
[{env, [{dispatch, Dispatch}]}]
... |
b42a9798ac75f2750930efd094ce78afec64d64c0684acc1848a4b78703c00c7 | esb-lwb/lwb | sat_test.clj | lwb Logic WorkBench -- Propositional Logic , tests
Copyright ( c ) 2014 - 2017 , THM . All rights reserved .
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php ) .
; By using this software in any fashion, you are agreeing to be bound by
; the terms of th... | null | https://raw.githubusercontent.com/esb-lwb/lwb/bba51ada7f7316341733d37b0dc4848c4891ef3a/test/lwb/prop/sat_test.clj | clojure | The use and distribution terms for this software are covered by the
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
dimacs --------------------------------------------------------------
sat4j ---------------------------------------------------------------
tseitin ... | lwb Logic WorkBench -- Propositional Logic , tests
Copyright ( c ) 2014 - 2017 , THM . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php ) .
(ns lwb.prop.sat-test
(:require [clojure.test :refer :all]
[lwb.prop :refer :all]
[lwb.prop.sat :refer :all]
[clojure.spe... |
07d41a31930e9bd1bea123995cf38ef9dae1bfa7fc2045a581356b931bd23465 | ericcervin/getting-started-with-sketching | pg054b.rkt | #lang sketching
(define (setup)
(size 220 120)
(smoothing 'smoothed)
(background 200)
(set-frame-rate! 60)
)
(define x 1)
(define easing 0.01)
(define (update-x)
(let ([target-x mouse-x])
(set! x (+ x (* (- target-x x) easing)))
(displayln (list target-x x))
)
)
(define (draw)
(... | null | https://raw.githubusercontent.com/ericcervin/getting-started-with-sketching/02969f7c85bb36ce83bbf96d38542619c4a1428a/pg054b.rkt | racket | #lang sketching
(define (setup)
(size 220 120)
(smoothing 'smoothed)
(background 200)
(set-frame-rate! 60)
)
(define x 1)
(define easing 0.01)
(define (update-x)
(let ([target-x mouse-x])
(set! x (+ x (* (- target-x x) easing)))
(displayln (list target-x x))
)
)
(define (draw)
(... | |
aae880fc728a2f06070e84637ed9c85d252a41e513b605c48e457a6c37ec3a6e | city41/reagent-breakout | level.cljs | (ns breakout.engine.level
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :refer [<!]]
[reagent.core :refer [atom]]
[breakout.engine.input :as input]
[breakout.levels.data :as levels])
(:import goog.math.Rect))
;; --- constants
(def tile-size ... | null | https://raw.githubusercontent.com/city41/reagent-breakout/84907d0cbc2d3cae917e30f955bc8e42fcb2d505/src/cljs/breakout/engine/level.cljs | clojure | --- constants
--- state, there's a lot of it (this is a game after all)
--- collision related
these functions detect collision and are called from update-state! :gameplay
does not pick the correct direction to flip
determines the x velocity for the ball based on where
on the paddle the ball struck. The closer to... | (ns breakout.engine.level
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :refer [<!]]
[reagent.core :refer [atom]]
[breakout.engine.input :as input]
[breakout.levels.data :as levels])
(:import goog.math.Rect))
(def tile-size 16)
(def board {:... |
13bbd01c0627377245e5eee54342fbe1ea557aed65fb47b5e9ed33d1567877d3 | morpheusgraphql/morpheus-graphql | ClientConnectionStore.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFam... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/f9684d1451fd4ee3aabdb821424fd352003a3982/morpheus-graphql-subscriptions/src/Data/Morpheus/Subscriptions/ClientConnectionStore.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
one connection can have multiple subscription session
stores active client connections
every registered client has ID
when client connection is closed client(including all its subscriptions) can By removed By its ID
returns original stor... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
module Data.Morpheus.Subscriptions.ClientConnectio... |
fd71129e114da083aa56c2213a375f34744074986a929886be7f2837c169e3ef | malob/prefmanager | Types.hs | module Defaults.Types where
import Patience.Map (Delta)
import Text.XML.Plist (PlObject)
| Name of a domain , e.g. , @NSGlobalDomain@ , @com.apple.finder@ , etc .
newtype DomainName = DomainName Text deriving (Eq, Ord, Show)
type Key = String
-- | Representation of the settings of a domain.
newtype Domain = Domai... | null | https://raw.githubusercontent.com/malob/prefmanager/bda3ea9b1963daa56bba698f61b957c131e7a260/src/Defaults/Types.hs | haskell | | Representation of the settings of a domain.
| Map of domains.
| Map representing the change of the values of keys of a domain. | module Defaults.Types where
import Patience.Map (Delta)
import Text.XML.Plist (PlObject)
| Name of a domain , e.g. , @NSGlobalDomain@ , @com.apple.finder@ , etc .
newtype DomainName = DomainName Text deriving (Eq, Ord, Show)
type Key = String
newtype Domain = Domain (Map Key PlObject) deriving (Eq, Ord, Show)
ne... |
79b7f69a2640fcef7afa6303d2e4a5431e06d4f288ba1423f1b2ada634c9aa21 | ledyba/bf2sat | SAT.hs | module Brainfuck2Sat.SAT (Time(..), Component(..), Fml(..), States, gen) where
import Brainfuck2Sat.Parser (Tree(..), Source(..))
import Brainfuck2Sat.Util (calcBitLength, toBitList, sortOn, showIO)
import Data.List (groupBy)
import Control.Applicative ((<$>))
import Data.Hashable (Hashable, hash, hashWithSalt)
impor... | null | https://raw.githubusercontent.com/ledyba/bf2sat/5ffdfbdf9b15d7d01bf00a6b475b8fccdc40b5d3/lib/Brainfuck2Sat/SAT.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
---... | module Brainfuck2Sat.SAT (Time(..), Component(..), Fml(..), States, gen) where
import Brainfuck2Sat.Parser (Tree(..), Source(..))
import Brainfuck2Sat.Util (calcBitLength, toBitList, sortOn, showIO)
import Data.List (groupBy)
import Control.Applicative ((<$>))
import Data.Hashable (Hashable, hash, hashWithSalt)
impor... |
cf839b2d001db28b4e30e9ace6a7316acbec8cbad4338c91539a0b1bcb6b60df | HugoPeters1024/hs-sleuth | Cut.hs | | Cut into a file , selecting certain columns ( e.g. columns 10 to 40 )
--
-- Tested in this benchmark:
--
-- * Reading the file
--
-- * Splitting into lines
--
-- * Taking a number of characters from the lines
--
-- * Joining the lines
--
-- * Writing back to a handle
--
module Benchmarks.Programs.Cut
( benchmar... | null | https://raw.githubusercontent.com/HugoPeters1024/hs-sleuth/385655e62031959a14a3bac5e9ccd1c42c045f0c/test-project/text-1.2.4.0/benchmarks/haskell/Benchmarks/Programs/Cut.hs | haskell |
Tested in this benchmark:
* Reading the file
* Splitting into lines
* Taking a number of characters from the lines
* Joining the lines
* Writing back to a handle
| | Cut into a file , selecting certain columns ( e.g. columns 10 to 40 )
module Benchmarks.Programs.Cut
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import System.IO (Handle, hPutStr)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.