_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
64268bbcb62dee5228b441b100c22cdec98f63d7ad48725d75f3f361e0999f23
heidihoward/ocaml-dns-examples
unikernel.ml
open Lwt open V1_LWT module Client (C:CONSOLE) (S:STACKV4) = struct module U = S.UDPV4 module DNS = Dns_resolver_mirage.Make(OS.Time)(S) open Dns.Packet open Dns.Name let start c s = Bootvar.create () >>= fun bootvar -> let domain = Bootvar.get_exn bootvar "domain" in let server = Ipaddr.V4.of...
null
https://raw.githubusercontent.com/heidihoward/ocaml-dns-examples/0d49f892079071d6cb3221e90a8c321984745e69/basic_dig/unikernel.ml
ocaml
open Lwt open V1_LWT module Client (C:CONSOLE) (S:STACKV4) = struct module U = S.UDPV4 module DNS = Dns_resolver_mirage.Make(OS.Time)(S) open Dns.Packet open Dns.Name let start c s = Bootvar.create () >>= fun bootvar -> let domain = Bootvar.get_exn bootvar "domain" in let server = Ipaddr.V4.of...
2ac1d7caad311f5caa5d31021eb1beb7d03d7e1a119c9fe650731129120bb7b8
unison-code/unison
DT.hs
| Copyright : Copyright ( c ) 2016 , RISE SICS AB License : BSD3 ( see the LICENSE file ) Maintainer : . Copyright : Copyright (c) 2016, RISE SICS AB License : BSD3 (see the LICENSE file) Maintainer : Dominance Tree. -} Main authors : < > This file is part of Uni...
null
https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Graphs/DT.hs
haskell
| Copyright : Copyright ( c ) 2016 , RISE SICS AB License : BSD3 ( see the LICENSE file ) Maintainer : . Copyright : Copyright (c) 2016, RISE SICS AB License : BSD3 (see the LICENSE file) Maintainer : Dominance Tree. -} Main authors : < > This file is part of Uni...
4cdc56b259880c4f8b613f2a00010b42a483cc609911378b14a6c573d3d7a5eb
prl-julia/juliette-wa
redex.rkt
#lang racket (require redex) ; import surface language (require "../../../src/redex/core/wa-surface.rkt") ; import full language (require "../../../src/redex/core/wa-full.rkt") ; import optimizations (require "../../../src/redex/optimizations/wa-optimized.rkt") (displayln "Test for litmus-wa/paper01:") (define p ...
null
https://raw.githubusercontent.com/prl-julia/juliette-wa/1d1a2154e7b4e232ea2166fba485a3bf574ebd88/tests/litmus-wa/paper01/redex.rkt
racket
import surface language import full language import optimizations
#lang racket (require redex) (require "../../../src/redex/core/wa-surface.rkt") (require "../../../src/redex/core/wa-full.rkt") (require "../../../src/redex/optimizations/wa-optimized.rkt") (displayln "Test for litmus-wa/paper01:") (define p (term (evalg (seq (mdef "g" () 2) (seq (mdef "f...
00d6eb5a85b3072806463896a18d761f96bab096f396afe2db76abe055e51870
odo/revolver
revolver_lease.erl
-module(revolver_lease). -export([init_state/1, new_pids/2, next_pid/1, release/2, pids/1, pid_down/2, delete_all_pids/1]). -record(state, { pids_available :: list(), pids_leased :: any() }). API for revolver init_state(lease) -> #state{ pids_available = [], pids_leased = sets:new() ...
null
https://raw.githubusercontent.com/odo/revolver/f9378f382d76c0af20081e558af882efa1c3f66d/src/revolver_lease.erl
erlang
-module(revolver_lease). -export([init_state/1, new_pids/2, next_pid/1, release/2, pids/1, pid_down/2, delete_all_pids/1]). -record(state, { pids_available :: list(), pids_leased :: any() }). API for revolver init_state(lease) -> #state{ pids_available = [], pids_leased = sets:new() ...
c0f41aa0a446133f4213fca0044763fecc5d472fa669e0f8017b5f97da1f2c95
psholtz/MIT-SICP
exercise1-37.scm
;; Exercise 1.37 ;; ;; An infinite continued fraction is an expression of the form: ;; ;; f = N1 ;; ---------------------------------- ;; D1 + N2 ;; ------------------ ;; D2 + N3 ;; -------- ;; ...
null
https://raw.githubusercontent.com/psholtz/MIT-SICP/01e9b722ac5008e26f386624849117ca8fa80906/Section-1.3/mit-scheme/exercise1-37.scm
scheme
An infinite continued fraction is an expression of the form: f = N1 ---------------------------------- D1 + N2 ------------------ D2 + N3 -------- D3 + ... As an example, ...
Exercise 1.37 N(i ) and the D(i ) all equal to 1 produces 1 / phi , where phi is the golden ration ( descibed in section 1.2.2 ) . One way to approximate an infinite continued fraction Suppose that n and d are procedures of one argument ( the term index i ) that return the N(i ) and D(i ) of the terms of the ...
814f4ccbe8a0e782cd776892240ef51b288d9b9828ce4bcba823658386a48977
green-coder/embassy
util.cljc
(ns embassy.client.util (:refer-clojure :exclude [get-in])) #?(:cljs (defn get-in "Returns a dom element from a sequence of indexes." [^js dom-element path] (reduce (fn [dom-element index] (-> dom-element .-childNodes (.item index))) dom-element path))) #_ ...
null
https://raw.githubusercontent.com/green-coder/embassy/178a866928944e7678c875888246000add503870/src/embassy/client/util.cljc
clojure
(ns embassy.client.util (:refer-clojure :exclude [get-in])) #?(:cljs (defn get-in "Returns a dom element from a sequence of indexes." [^js dom-element path] (reduce (fn [dom-element index] (-> dom-element .-childNodes (.item index))) dom-element path))) #_ ...
505c80934a272d96fd16af05a8a84e6dc7f0e55a710bc86aea052bfc3456f8e3
gonzojive/elephant
stress-test.lisp
(in-package :elephant-tests) (defparameter *spec* '(:bdb "/Users/eslick/Work/db/test")) (defparameter *names* '("David" "Jim" "Peter" "Thomas" "Arthur" "Jans" "Klaus" "James" "Martin")) (defclass person () ((name :initform (elt *names* (random (length *names*))) :accessor name ...
null
https://raw.githubusercontent.com/gonzojive/elephant/b29a012ab75ccea2fc7fc4f1e9d5e821f0bd60bf/tests/stress-test.lisp
lisp
Actually the index t shouldn't be needed, but since elephant sometimes complained that "person is not an index class", I try if this fixes it. I have tried different places for with-transaction below (cl-fad:delete-directory-and-files dir))
(in-package :elephant-tests) (defparameter *spec* '(:bdb "/Users/eslick/Work/db/test")) (defparameter *names* '("David" "Jim" "Peter" "Thomas" "Arthur" "Jans" "Klaus" "James" "Martin")) (defclass person () ((name :initform (elt *names* (random (length *names*))) :accessor name ...
b57ad3d870b34190a49d45633a5477ea18b3459f195e8331a4732aab05cbae22
egraphdb/egraphdb
egraph_fuse.erl
%%%------------------------------------------------------------------- @author neerajsharma ( C ) 2018 , %%% @doc %%% %%% @end %%%------------------------------------------------------------------- -module(egraph_fuse). -author("neerajsharma"). -export([api_model_to_fuse/1, circuit_broken/1, s...
null
https://raw.githubusercontent.com/egraphdb/egraphdb/41a0131be227f7f0a35ba0e2c1cb23d70cd86b03/src/egraph_fuse.erl
erlang
------------------------------------------------------------------- @doc @end ------------------------------------------------------------------- async querying fuse state is known to have race conditions but is very fast and do not block unlike sync. This implies that it will take a while for fuse to reflect tr...
@author neerajsharma ( C ) 2018 , -module(egraph_fuse). -author("neerajsharma"). -export([api_model_to_fuse/1, circuit_broken/1, setup/1, blown/1, melt/1]). -spec api_model_to_fuse(atom()) -> undefined | atom(). api_model_to_fuse(_) -> http_api_latency. -spec circuit_br...
fabcf317b25f9d029ab59f59acf593a02f2e9818c4bad122976d978390d51b45
rbkmoney/hellgate
hg_maybe.erl
-module(hg_maybe). -export([apply/2]). -export([apply/3]). -export([get_defined/1]). -export([get_defined/2]). -type maybe(T) :: undefined | T. -export_type([maybe/1]). -spec apply(fun(), Arg :: undefined | term()) -> term(). apply(Fun, Arg) -> hg_maybe:apply(Fun, Arg, undefined). -spec apply(fun(), Arg :...
null
https://raw.githubusercontent.com/rbkmoney/hellgate/c3e7413db06296a72fb64268eca98e63379d2ef5/apps/hellgate/src/hg_maybe.erl
erlang
-module(hg_maybe). -export([apply/2]). -export([apply/3]). -export([get_defined/1]). -export([get_defined/2]). -type maybe(T) :: undefined | T. -export_type([maybe/1]). -spec apply(fun(), Arg :: undefined | term()) -> term(). apply(Fun, Arg) -> hg_maybe:apply(Fun, Arg, undefined). -spec apply(fun(), Arg :...
e1bd5b6ed8e804ebd7e883e5a0c7b87c507fae62d123c5a1e54d29eeaa4ea6f3
paurkedal/inhca
pkg.ml
#! /usr/bin/env ocaml #use "topfind" #require "topkg" open Topkg let licenses = [Pkg.std_file "COPYING"] let opams = [Pkg.opam_file "inhca.opam"] let build_cmd c os targets = let ocamlbuild = Conf.tool "ocamlbuild" os in let build_dir = Conf.build_dir c in OS.Cmd.run @@ Cmd.(ocamlbuild % "-use-ocamlfi...
null
https://raw.githubusercontent.com/paurkedal/inhca/c2cc4abce931684fb17ac88169822178956f18e3/pkg/pkg.ml
ocaml
#! /usr/bin/env ocaml #use "topfind" #require "topkg" open Topkg let licenses = [Pkg.std_file "COPYING"] let opams = [Pkg.opam_file "inhca.opam"] let build_cmd c os targets = let ocamlbuild = Conf.tool "ocamlbuild" os in let build_dir = Conf.build_dir c in OS.Cmd.run @@ Cmd.(ocamlbuild % "-use-ocamlfi...
00235939a52ea46f4559960a1f4f4033db239c0e8afd06b98b3246d9dd27372a
gafiatulin/codewars
Arrays.hs
-- Sum of positive -- module Codewars.Arrays where positiveSum :: [Int] -> Int positiveSum = sum . filter (> 0)
null
https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/8%20kyu/Arrays.hs
haskell
Sum of positive
module Codewars.Arrays where positiveSum :: [Int] -> Int positiveSum = sum . filter (> 0)
3a5adfc394c78c214ab8e4fa4071bec4cef3317c599b97813a630fcea10cb8f4
ocaml-multicore/tezos
test_preendorsement_functor.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < > (* ...
null
https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_012_Psithaca/lib_protocol/test/test_preendorsement_functor.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETH...
0125ec0402298c144447a34091307f47363430109fb8e7b4232d222e1fa63e28
nuvla/api-server
cookies_test.clj
(ns sixsq.nuvla.auth.cookies-test (:refer-clojure :exclude [update]) (:require [clojure.test :refer [deftest is use-fixtures]] [environ.core :as environ] [ring.util.codec :as codec] [sixsq.nuvla.auth.cookies :as t] [sixsq.nuvla.auth.env-fixture :as env-fixture] [sixsq.nuvla.server.app.params...
null
https://raw.githubusercontent.com/nuvla/api-server/6d06c268b8247372af697d0bb197ac59d9672cb1/code/test/sixsq/nuvla/auth/cookies_test.clj
clojure
(ns sixsq.nuvla.auth.cookies-test (:refer-clojure :exclude [update]) (:require [clojure.test :refer [deftest is use-fixtures]] [environ.core :as environ] [ring.util.codec :as codec] [sixsq.nuvla.auth.cookies :as t] [sixsq.nuvla.auth.env-fixture :as env-fixture] [sixsq.nuvla.server.app.params...
de0ed488bcca8afd4de519f7028aff43a7d1c9f6dd89b9d0db670db49a2e428a
backtracking/astro
planets.mli
(* Planets positions given by longitude, latitude (in degrees) and distance from the Sun in AU. *) type planet_position = Astro.coordonnees_heliocentriques type julian_day = float val mercury : julian_day -> planet_position val venus : julian_day -> planet_position val earth : julian_day -> planet_position v...
null
https://raw.githubusercontent.com/backtracking/astro/adb8020b8a56692f3d2b50d26dce2ccc442c6f39/planets.mli
ocaml
Planets positions given by longitude, latitude (in degrees) and distance from the Sun in AU.
type planet_position = Astro.coordonnees_heliocentriques type julian_day = float val mercury : julian_day -> planet_position val venus : julian_day -> planet_position val earth : julian_day -> planet_position val mars : julian_day -> planet_position val jupiter : julian_day -> planet_position val saturn : j...
7c89699ee5d1356849d5fbf0c764949ffdd6474164eb0c07e934fdf58c9c11f8
jeromesimeon/Galax
jungle.mli
(***********************************************************************) (* *) (* GALAX *) (* XQuery Engine *) (* ...
null
https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/tools/Jungle/jungle.mli
ocaml
********************************************************************* GALAX XQuery Engine ...
Copyright 2001 - 2007 . exception Jungle_Error of string val get_put_count : unit -> int val get_get_count : unit -> int Generic open flags for all kinds of index type jungle_open_flags = | JDB_CREATE | JDB_EXCL | JDB_DIRTY_READ | JDB_RDONLY | JDB_THR...
448d061cf9f82ad2c7dbdd687a02d5562b7816b4e804cb38b1e6c125001093c2
anoma/juvix
Negative.hs
module Scope.Negative (allTests) where import Base import Juvix.Compiler.Builtins (iniState) import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping.Error import Juvix.Compiler.Pipeline type FailMsg = String data NegTest a = NegTest { _name :: String, _relDir :: Path Rel Dir, _file :: Path R...
null
https://raw.githubusercontent.com/anoma/juvix/098c256da83556f8b32a831468a8d38783a967e8/test/Scope/Negative.hs
haskell
module Scope.Negative (allTests) where import Base import Juvix.Compiler.Builtins (iniState) import Juvix.Compiler.Concrete.Translation.FromParsed.Analysis.Scoping.Error import Juvix.Compiler.Pipeline type FailMsg = String data NegTest a = NegTest { _name :: String, _relDir :: Path Rel Dir, _file :: Path R...
62b9237c9a3fa6e7902c67f71c009ac19448dc30528a771fd8865871090650f0
jacekschae/learn-datomic-course-files
db.clj
(ns cheffy.recipe.db (:require [datomic.client.api :as d])) (def recipe-pattern [:recipe/recipe-id :recipe/prep-time :recipe/display-name :recipe/image-url :recipe/public? :recipe/favorite-count {:recipe/owner [:account/account-id :account/display-name]} {:recipe/steps [:step/step...
null
https://raw.githubusercontent.com/jacekschae/learn-datomic-course-files/fe558c573f05697e97cd606add16c8c113678e9e/increments/27-delete-recipe/src/main/cheffy/recipe/db.clj
clojure
public drafts
(ns cheffy.recipe.db (:require [datomic.client.api :as d])) (def recipe-pattern [:recipe/recipe-id :recipe/prep-time :recipe/display-name :recipe/image-url :recipe/public? :recipe/favorite-count {:recipe/owner [:account/account-id :account/display-name]} {:recipe/steps [:step/step...
69162770fa65c6de3e5ac9d5d11aa739c49ea3dce376d36b34e34f83ea6cdc2d
ocaml-multicore/ocaml-tsan
clflags.mli
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/ae9c1502103845550162a49fcd3f76276cdfa866/utils/clflags.mli
ocaml
************************************************************************ OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 2005 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the module Int_arg_helper : sig type parsed val parse : string -> string -> parsed ref -> unit typ...
7b9c9ea131779f8922cc4369c5f244ab463266b08925ffde226eb7333ffd319c
originrose/cortex
cuda_gradient_test.clj
(ns ^:gpu cortex.compute.nn.cuda-gradient-test (:require [clojure.test :refer :all] [cortex.compute.verify.utils :refer [def-double-float-test] :as verify-utils] ;[cortex.compute.cuda.backend :as cuda-backend] [cortex.verify.nn.gradient :as verify-gradient] [cortex.nn.e...
null
https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/test/clj/cortex/compute/nn/cuda_gradient_test.clj
clojure
[cortex.compute.cuda.backend :as cuda-backend] The gradient tests are just too sensitive to precision to work well here as the GPU has different precision than the CPU for things. Doubles work fine but
(ns ^:gpu cortex.compute.nn.cuda-gradient-test (:require [clojure.test :refer :all] [cortex.compute.verify.utils :refer [def-double-float-test] :as verify-utils] [cortex.verify.nn.gradient :as verify-gradient] [cortex.nn.execute :as execute])) (use-fixtures :each verify-utils/test...
76df4aca8880ac56a5fa3e7f364aba68a5803b7b083dda32e581c75f9b29ab3e
exercism/babashka
project.clj
(defproject space-age "0.1.0-SNAPSHOT" :description "space-age exercise." :url "-age" :dependencies [[org.clojure/clojure "1.10.0"]])
null
https://raw.githubusercontent.com/exercism/babashka/707356c52e08490e66cb1b2e63e4f4439d91cf08/exercises/practice/space-age/project.clj
clojure
(defproject space-age "0.1.0-SNAPSHOT" :description "space-age exercise." :url "-age" :dependencies [[org.clojure/clojure "1.10.0"]])
6ae1a00fb88a03d0a74e6cf3803275b4d86317792c6162ff1a877006915135b4
rems-project/lem
pmap.mli
(***********************************************************************) (* *) (* Objective Caml *) (* *) , projet ...
null
https://raw.githubusercontent.com/rems-project/lem/a839114e468119d9ac0868d7dc53eae7f3cc3a6c/ocaml-lib/pmap.mli
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 Modified by 2010 - 11 - 30 $ I d ...
8f137ef1eeec6592f31c6594fdc6525237c26158c8de0baa862beffd66134075
B-Lang-org/bsc
ListMap.hs
Copyright ( c ) 1982 - 1999 , -- See LICENSE for the full license. -- module ListMap( ListMap, toList, fromList, length, null, lookup, lookupWithDefault, lookupWithDefaultBy, lookupBy ) where import Prelude -- @@ Lists as finite mappings. type ListMap a b = [(a, ...
null
https://raw.githubusercontent.com/B-Lang-org/bsc/bd141b505394edc5a4bdd3db442a9b0a8c101f0f/src/comp/Libs/ListMap.hs
haskell
See LICENSE for the full license. @@ Lists as finite mappings.
Copyright ( c ) 1982 - 1999 , module ListMap( ListMap, toList, fromList, length, null, lookup, lookupWithDefault, lookupWithDefaultBy, lookupBy ) where import Prelude type ListMap a b = [(a, b)] toList :: ListMap a b -> [(a, b)] toList l = l fromList :: [(a, b)...
42a59eeaccece85adedb5e48c00889244b7d295c480c3d9bd1f88d95a239741c
aryx/ocamltarzan
pa_sexp_conv.ml
pp camlp4orf File : pa_sexp_conv.ml Copyright ( C ) 2005- Jane Street Holding , LLC Author : email : mmottl\@janestcapital.com WWW : This file is derived from file " pa_tywith.ml " of version 0.45 of the library " " . is Copyright ( C ) 2004 , 2005 by ...
null
https://raw.githubusercontent.com/aryx/ocamltarzan/4140f5102cee83a2ca7be996ca2d92e9cb035f9c/pa/pa_sexp_conv.ml
ocaml
Pa_sexp_conv: Preprocessing Module for Automated S-expression Conversions Utility functions impossible impossible Generators for S-expressions Generates the signature for type conversion to S-expressions Generates the signature for type conversion from S-expressions Generates the signature for type conve...
pp camlp4orf File : pa_sexp_conv.ml Copyright ( C ) 2005- Jane Street Holding , LLC Author : email : mmottl\@janestcapital.com WWW : This file is derived from file " pa_tywith.ml " of version 0.45 of the library " " . is Copyright ( C ) 2004 , 2005 by ...
9f5212be96a86d5d2fc4651340f0e3821d238d864e9f940b9716bb21b44775b5
WorksHub/client
url.cljc
(ns wh.common.url (:require #?(:clj [ring.util.codec :as codec]) #?(:clj [taoensso.timbre :refer [error]]) [#?(:clj clojure.spec.alpha :cljs cljs.spec.alpha) :as s] [#?(:clj clojure.spec.gen.alpha :cljs cljs.spec.gen.alpha) :as gen] #...
null
https://raw.githubusercontent.com/WorksHub/client/370a0be7890ed909e05238f3264f57e3cf2d9e8f/common/src/wh/common/url.cljc
clojure
'-separated else
(ns wh.common.url (:require #?(:clj [ring.util.codec :as codec]) #?(:clj [taoensso.timbre :refer [error]]) [#?(:clj clojure.spec.alpha :cljs cljs.spec.alpha) :as s] [#?(:clj clojure.spec.gen.alpha :cljs cljs.spec.gen.alpha) :as gen] #...
bd40092c4c8b0aca6c4c707bc1fb5eb37a0d2cfafa98d575f5bf7abad38f8ee2
mtgred/netrunner
rewrite.clj
(ns game.rewrite (:require [clojure.java.io :as io] [jinteki.utils :refer [slugify]] [rewrite-clj.node :as n] [rewrite-clj.zip :as z] [clojure.string :as str])) (defn deftest? [zloc] (= "deftest" (z/string zloc))) (defn testing? [zloc] (= "testing" (z/string zloc))) (defn basic-test? [zloc] (a...
null
https://raw.githubusercontent.com/mtgred/netrunner/4f8e61fef533e2838f6dcd2bfad28e71ee5de2d5/test/clj/game/rewrite.clj
clojure
testing re-enter list "asdf" re-enter list remove outer list basic test at the end? final position testing branch final position all else non-final testing branch
(ns game.rewrite (:require [clojure.java.io :as io] [jinteki.utils :refer [slugify]] [rewrite-clj.node :as n] [rewrite-clj.zip :as z] [clojure.string :as str])) (defn deftest? [zloc] (= "deftest" (z/string zloc))) (defn testing? [zloc] (= "testing" (z/string zloc))) (defn basic-test? [zloc] (a...
b44655d46f20941cbb14febd0d5693f287794f0c928300b8b26b1e85f55c9c04
chetant/LibClang
TranslationUnit.hs
{-# LANGUAGE ConstraintKinds #-} # LANGUAGE FlexibleContexts # {-# LANGUAGE RankNTypes #-} -- | Functions for manipulating translation units. -- -- To start analyzing a translation unit, call 'Index.withNew' to create a new index and -- call 'withParsed' in the callback. Inside the callback for 'withParsed', you'll ha...
null
https://raw.githubusercontent.com/chetant/LibClang/5e6d245024f7005e1a1dd1076031954b7cd8702f/src/Clang/TranslationUnit.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE RankNTypes # | Functions for manipulating translation units. To start analyzing a translation unit, call 'Index.withNew' to create a new index and call 'withParsed' in the callback. Inside the callback for 'withParsed', you'll have AST cursor which can be traversed using the...
# LANGUAGE FlexibleContexts # access to a ' FFI.TranslationUnit ' value ; you can call ' getCursor ' to turn that into an module Clang.TranslationUnit ( withParsed , withLoaded , withReparsing , FFI.TranslationUnitFlags , FFI.ReparseFlags , ReparsingCallback , ParseContinuation(..) , save , FFI.SaveTranslationUn...
2c4b53eefc4e7e4b0b999a19deca4396134a52ffe36cacb42764f46aca90251a
wavejumper/boonmee
cli.clj
(ns boonmee.cli (:require [boonmee.client.stdio :as client.stdio] [clojure.java.io :as io] [clojure.tools.cli :as tools.cli] [integrant.core :as ig]) (:import (java.util.concurrent CountDownLatch)) (:gen-class)) (def cli-options [["-c" "--client client" "Specify client" ...
null
https://raw.githubusercontent.com/wavejumper/boonmee/fc0946568bfc53830717d2b68982872972bd532d/src/boonmee/cli.clj
clojure
(ns boonmee.cli (:require [boonmee.client.stdio :as client.stdio] [clojure.java.io :as io] [clojure.tools.cli :as tools.cli] [integrant.core :as ig]) (:import (java.util.concurrent CountDownLatch)) (:gen-class)) (def cli-options [["-c" "--client client" "Specify client" ...
aba2af7152ae626eb5253dc6f40b46856201ca374f74996bad6738e5b0fae70b
Gabriella439/nix-diff
Main.hs
module Main where import Test.Tasty import Golden.Utils (initSimpleDerivations, initComplexDerivations) import Golden.Tests (goldenTests) import Properties (properties) main :: IO () main = do simpleTd <- initSimpleDerivations complexTd <- initComplexDerivations defaultMain $ testGroup "Tests" [goldenTes...
null
https://raw.githubusercontent.com/Gabriella439/nix-diff/8d365e5e8fe9d86add59aab07f79d05ca51d6ade/test/Main.hs
haskell
module Main where import Test.Tasty import Golden.Utils (initSimpleDerivations, initComplexDerivations) import Golden.Tests (goldenTests) import Properties (properties) main :: IO () main = do simpleTd <- initSimpleDerivations complexTd <- initComplexDerivations defaultMain $ testGroup "Tests" [goldenTes...
45aad42e70de2c2a129395e61b5936ece5defc3820852726273a71902339df82
ChillkroeteTTS/fischer
utils_test.clj
(ns fischer.utils-test (:require [clojure.test :refer :all] [fischer.utils :as utils] [clojure.java.io :as io])) (deftest sorted-keyset-test (is (= [[{:key1 :key1} :val1] [{:key2 :key2} :val2]] (utils/sorted-kv-list {{:key1 :key1} 0 {:key2 :key2} 1} ...
null
https://raw.githubusercontent.com/ChillkroeteTTS/fischer/2f479ac0d410f536f5bd89659d7f69113422784a/test/clj/fischer/utils_test.clj
clojure
(ns fischer.utils-test (:require [clojure.test :refer :all] [fischer.utils :as utils] [clojure.java.io :as io])) (deftest sorted-keyset-test (is (= [[{:key1 :key1} :val1] [{:key2 :key2} :val2]] (utils/sorted-kv-list {{:key1 :key1} 0 {:key2 :key2} 1} ...
1e7a3dc3494ca57145760dabbc955e69e821b436a27d35688c58e799bdebd423
Bodigrim/arithmoi
Cbrt.hs
-- | Module : Math . . Moduli . Cbrt Copyright : ( c ) 2020 Licence : MIT Maintainer : < > -- -- <#Cubic_residue_character Cubic symbol> of two Eisenstein Integers . # LANGUAGE LambdaCase # module Math.NumberTheory.Moduli.Cbrt ( CubicSymbol(..) , cubicSymbol , symbolToNum ) whe...
null
https://raw.githubusercontent.com/Bodigrim/arithmoi/6bc5e70417c87f67a0d87720902d4c89bc187007/Math/NumberTheory/Moduli/Cbrt.hs
haskell
| <#Cubic_residue_character Cubic symbol> | Represents the <#Cubic_residue_character cubic residue character> | The set of cubic symbols form a semigroup. Note `stimes` is allowed to take non-positive values. In other words, the set ω² | Converts a <#Cubic_residue_character cubic symbol> The algorithm `cubi...
Module : Math . . Moduli . Cbrt Copyright : ( c ) 2020 Licence : MIT Maintainer : < > of two Eisenstein Integers . # LANGUAGE LambdaCase # module Math.NumberTheory.Moduli.Cbrt ( CubicSymbol(..) , cubicSymbol , symbolToNum ) where import Math.NumberTheory.Quadratic.EisensteinIn...
1c619695f8e24707c4e4c1707ebe0e26ea3b75564880bf9a9ed0bdfb61fdf0fc
gvolpe/haskell-book-exercises
foldable.hs
import Data.Monoid data Identity a = Identity a instance Foldable Identity where foldr f z (Identity x) = f x z foldl f z (Identity x) = f z x foldMap f (Identity x) = f x data Optional a = Yep a | Nada instance Foldable Optional where foldr _ z Nada = z foldr f z (Yep x) = f x z foldl _ z Nada = ...
null
https://raw.githubusercontent.com/gvolpe/haskell-book-exercises/5c1b9d8dc729ee5a90c8709b9c889cbacb30a2cb/chapter20/foldable.hs
haskell
import Data.Monoid data Identity a = Identity a instance Foldable Identity where foldr f z (Identity x) = f x z foldl f z (Identity x) = f z x foldMap f (Identity x) = f x data Optional a = Yep a | Nada instance Foldable Optional where foldr _ z Nada = z foldr f z (Yep x) = f x z foldl _ z Nada = ...
71ea36fd8ee861d5d4925d2490d67544937dfdc22bf42fb77cd9e93e3794780f
falsetru/htdp
17.8.6.scm
(define wp? cons?) (define (web=? a-wp another-wp) (cond [(empty? a-wp) (empty? another-wp)] [(symbol? (first a-wp)) (and (and (cons? another-wp) (symbol? (first another-wp))) (and (symbol=? (first a-wp) (first another-wp)) (web=? (rest a-wp) (rest another-wp))))] [else ...
null
https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/17/17.8.6.scm
scheme
+----------------+--------+---------------+-------------------+ | | empty? | (cons s wp) | (cons ewp wp) | +----------------+--------+---------------+-------------------+ | empty? | O | X | X | +----------------+--------+---------------+----------------...
(define wp? cons?) (define (web=? a-wp another-wp) (cond [(empty? a-wp) (empty? another-wp)] [(symbol? (first a-wp)) (and (and (cons? another-wp) (symbol? (first another-wp))) (and (symbol=? (first a-wp) (first another-wp)) (web=? (rest a-wp) (rest another-wp))))] [else ...
63ef1922c6ab7597074c9e22bbc3e1c9aebcf57dab0f33d4f0fd7979e919ea17
SecPriv/webspec
cspcheck.mli
(********************************************************************************) Copyright ( c ) 2022 (* *) (* Permission is hereby granted, free of charge, to any person obtaining a *) (* copy of this software and associated doc...
null
https://raw.githubusercontent.com/SecPriv/webspec/b7ff6b714b3a4b572c108cc3136506da3d263eff/verifier/src/cspcheck.mli
ocaml
****************************************************************************** Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), th...
Copyright ( c ) 2022 to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHER IN AN ACTION OF CONTRACT...
9f9679ff927292d5240c2a27a5c3a10a54a8240f77829a3ee09c7ba2ba058fb5
Incubaid/baardskeerder
crc32c.mli
* This file is part of Baardskeerder . * * Copyright ( C ) 2011 Incubaid BVBA * * Baardskeerder is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , o...
null
https://raw.githubusercontent.com/Incubaid/baardskeerder/3975cb7f0e92e1f35eeab17beeb906344e43dae0/src/crc32c.mli
ocaml
calculate crc32_c buffer offset length -> crc32
* This file is part of Baardskeerder . * * Copyright ( C ) 2011 Incubaid BVBA * * Baardskeerder is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , o...
aa43c63682d365ce24cb0485689aeb3dd8d9d54677d33a0bc03f593f3b40d19a
jepst/CloudHaskell
KMeans.hs
# LANGUAGE TemplateHaskell , DeriveDataTypeable , BangPatterns # module Main where import Remote import Remote.Process (roundtripResponse,setRemoteNodeLogConfig,getConfig,PayloadDisposition(..),roundtripQuery,roundtripQueryMulti) import KMeansCommon import Control.Exception (try,SomeException,evaluate) import Control...
null
https://raw.githubusercontent.com/jepst/CloudHaskell/6acbcb6b2fc6bb6789cce2083cdd4747ef427627/examples/kmeans/KMeans.hs
haskell
evaluate or return? say $ "Got peers: " ++ show peers liftIO $ B.writeFile "kmeans-converged" $ encode $ Map.toList $ Map.unionsWith (++) (rights respoints)
# LANGUAGE TemplateHaskell , DeriveDataTypeable , BangPatterns # module Main where import Remote import Remote.Process (roundtripResponse,setRemoteNodeLogConfig,getConfig,PayloadDisposition(..),roundtripQuery,roundtripQueryMulti) import KMeansCommon import Control.Exception (try,SomeException,evaluate) import Control...
ac2d3c3599ede0f0636010226c63fa2f33ef03d0b16f0de3dc9a824603ada81b
serokell/haskell-crypto
Main.hs
SPDX - FileCopyrightText : 2021 > -- SPDX - License - Identifier : MPL-2.0 module Main (main) where import Data.ByteArray (constEq) import Data.SensitiveBytes (withSecureMemory) import Data.SensitiveBytes.IO (withUserPassword) main :: IO () main = withSecureMemory $ do withUserPassword 128 (Just "Password:...
null
https://raw.githubusercontent.com/serokell/haskell-crypto/94045832c184ff2519dccb975b982f7825ae02f4/secure-memory/app/checkpw/Main.hs
haskell
SPDX - FileCopyrightText : 2021 > SPDX - License - Identifier : MPL-2.0 module Main (main) where import Data.ByteArray (constEq) import Data.SensitiveBytes (withSecureMemory) import Data.SensitiveBytes.IO (withUserPassword) main :: IO () main = withSecureMemory $ do withUserPassword 128 (Just "Password: ")...
8814605d527f4cabceb6aa72ce1dec12bc1dc5abcd27786411adfe4e0d6a74a2
mzp/coq-ruby
coq_micromega.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/micromega/coq_micromega.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** ...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * : A reflexive tactic usin...
60451302a301ccf745466e9897dc563304a6371cf15f33560d8758a553653482
privet-kitty/cl-competitive
rolling-hash62.lisp
(defpackage :cp/test/rolling-hash62 (:use :cl :fiveam :cp/rolling-hash62) (:import-from :cp/test/base #:base-suite)) (in-package :cp/test/rolling-hash62) (in-suite base-suite) (test rolling-hash62 (declare (notinline make-rhash rhash-query rhash-concat rhash-get-lcp rhash-vector-hash)) (let ((rhash1 (make-rhas...
null
https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/test/rolling-hash62.lisp
lisp
hash code of a given sequence longest common prefix
(defpackage :cp/test/rolling-hash62 (:use :cl :fiveam :cp/rolling-hash62) (:import-from :cp/test/base #:base-suite)) (in-package :cp/test/rolling-hash62) (in-suite base-suite) (test rolling-hash62 (declare (notinline make-rhash rhash-query rhash-concat rhash-get-lcp rhash-vector-hash)) (let ((rhash1 (make-rhas...
76cd49b1a3429e174745cdc91cf5ab1e1612d86be7799742c3b68f0e1d731d5e
rickeyski/slack-api
Utils.hs
module Web.Slack.Utils where import Data.Char toSnake :: String -> String toSnake (a:b:c) | isAlpha a && (isUpper b || isDigit b) = toLower a : '_' : toSnake (toLower b : c) | otherwise = toLower a : toSnake (b:c) toSnake [x] = [toLower x] toSnake [] = [] toCamel :: String -> String toCamel ('_':x:xs)...
null
https://raw.githubusercontent.com/rickeyski/slack-api/5f6659e09bce19fe0ca9dfce8743bec7de518d77/src/Web/Slack/Utils.hs
haskell
module Web.Slack.Utils where import Data.Char toSnake :: String -> String toSnake (a:b:c) | isAlpha a && (isUpper b || isDigit b) = toLower a : '_' : toSnake (toLower b : c) | otherwise = toLower a : toSnake (b:c) toSnake [x] = [toLower x] toSnake [] = [] toCamel :: String -> String toCamel ('_':x:xs)...
9c48bb7c1dc4f13799432e041955adb0ca05f5af5eadbb5286419721b3d92dec
rescript-lang/rescript-compiler
ext_pervasives.mli
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or * ( at your option ) any later...
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/ext/ext_pervasives.mli
ocaml
val try_it : (unit -> 'a) -> unit external id : 'a -> 'a = "%identity" * Copied from {!Btype.hash_variant}: need sync up and add test case val hash_variant : string -> int
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or * ( at your option ) any later...
d03db57ab1f65c35fc69f2f5929f4139e9e12426c00e4e5aec3823832532b5c5
sullyj3/adventofcode2022
Day14.hs
# OPTIONS_GHC -Wno - missing - signatures # module Day14 (main) where import AOC import AOC.Parse import AOC.Parsers import PyF ( str ) -- |~) _ _ _. _ _ |~ ( _ || _ |(_| -- _| -- >>> parseInput $ exampleInput parseInp...
null
https://raw.githubusercontent.com/sullyj3/adventofcode2022/1df7ca92d6651753f1df5e98da1ed449a0858bf0/src/Day14.hs
haskell
|~) _ _ _. _ _ _| >>> parseInput $ exampleInput |~) _ __|_ /~\ _ _ |~ (_|| | \_/| |(/_ |~) _ __|_ ~|~ _ |~ (_|| | |VV(_) |\/| _ . _ | |(_||| | other...
# OPTIONS_GHC -Wno - missing - signatures # module Day14 (main) where import AOC import AOC.Parse import AOC.Parsers import PyF ( str ) |~ ( _ || _ |(_| parseInput :: Text -> [()] parseInput = unsafeParse $ linesOf $ pure () > > > part1 . parseInput $ exampleInput...
c842d13864f6019ff07884976a35289dc38eab64b90b78ee13cf75807bdd4040
kowainik/tomland
Di.hs
module Test.Toml.Codec.Di ( diSpec ) where import Control.Applicative ((<|>)) import Data.Text (Text) import Hedgehog (Gen) import Test.Hspec (Spec, describe) import Test.Toml.Codec.Combinator.Common (codecRoundtrip) import Toml.Codec.Di (dimatch) import Toml.Codec.Types (TomlCodec) import Toml.Type.Key (Key)...
null
https://raw.githubusercontent.com/kowainik/tomland/2b4bcc465b79873a61bccfc7131d423a9a0aec1d/test/Test/Toml/Codec/Di.hs
haskell
module Test.Toml.Codec.Di ( diSpec ) where import Control.Applicative ((<|>)) import Data.Text (Text) import Hedgehog (Gen) import Test.Hspec (Spec, describe) import Test.Toml.Codec.Combinator.Common (codecRoundtrip) import Toml.Codec.Di (dimatch) import Toml.Codec.Types (TomlCodec) import Toml.Type.Key (Key)...
f5e999c43ed64b33b228248ba097ac7d137746a2d8a31d692e52b3c7709b98b8
mfoemmel/erlang-otp
wxPaletteChangedEvent.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 2008 - 2009 . All Rights Reserved . %% The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Pub...
null
https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxPaletteChangedEvent.erl
erlang
%CopyrightBegin% compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at /. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limita...
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved . The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in Software distributed under the License is distributed on an " AS IS " -module(wxPaletteChangedEvent). -include(...
47725758a71b83b9420ed84c96aaf57b2e67369be4bb488df3ce035d4802c83b
cyga/real-world-haskell
MonadHandleIO.hs
file : ch15 / MonadHandleIO.hs # LANGUAGE FunctionalDependencies , MultiParamTypeClasses # import MonadHandle import qualified System.IO import System.IO (IOMode(..)) import Control.Monad.Trans (MonadIO(..), MonadTrans(..)) import System.Directory (removeFile) import SafeHello instance MonadHandle System.IO.Handl...
null
https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch15/MonadHandleIO.hs
haskell
file : ch15 / MonadHandleIO.hs # LANGUAGE FunctionalDependencies , MultiParamTypeClasses # import MonadHandle import qualified System.IO import System.IO (IOMode(..)) import Control.Monad.Trans (MonadIO(..), MonadTrans(..)) import System.Directory (removeFile) import SafeHello instance MonadHandle System.IO.Handl...
790287c506dfc42afdec679f7e6e9bd149401c8b97fdd9178bdb3fa8bbd2b7ab
grin-compiler/ghc-wpc-sample-programs
Regressions.hs
module Main where import Control.Applicative ((<$>)) import Control.Monad (replicateM) import qualified Data.HashMap.Strict as HM import Data.List (delete) import Data.Maybe import Test.HUnit (Assertion, assert) import Test.Framework (Test, defaultMain) import Test.Framework.Providers.HUnit (testCase) import Test.Fram...
null
https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/unordered-containers-0.2.10.0/tests/Regressions.hs
haskell
---------------------------------------------------------------------- ---------------------------------------------------------------------- * Test list ---------------------------------------------------------------------- * Test harness
module Main where import Control.Applicative ((<$>)) import Control.Monad (replicateM) import qualified Data.HashMap.Strict as HM import Data.List (delete) import Data.Maybe import Test.HUnit (Assertion, assert) import Test.Framework (Test, defaultMain) import Test.Framework.Providers.HUnit (testCase) import Test.Fram...
d4b288b6ed7074b8aa7ab49576b74ca065cde2bd77fe5f4c524d00dba133a2e5
NicklasBoto/funQ
Gates.hs
{-# LANGUAGE ScopedTypeVariables #-} # LANGUAGE NoImplicitPrelude # {-# LANGUAGE BlockArguments #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAG...
null
https://raw.githubusercontent.com/NicklasBoto/funQ/9444da05273be215a66044b976d031229d8832fc/legacy/Gates.hs
haskell
# LANGUAGE ScopedTypeVariables # # LANGUAGE BlockArguments # # LANGUAGE TypeFamilies # # LANGUAGE Rank2Types # # LANGUAGE DataKinds # | Module : Gates Descrip...
# LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -fplugin GHC.TypeLits . KnownNat . Solver # # OPTIONS_HADDOCK not - home # module Gates where import QData import Numeric.LinearAlgebra.Static as V hiding ( outer ) import Numeric.LinearAlgebra ( flatten, out...
cf8faf36d717616e0003ef81b9f6ccd219db455c20051c9184cf6a059ea197aa
fredlund/McErlang
stop_after_relevant_order.erl
@author 2006 - 2009 %% @doc @private -module(stop_after_relevant_order). -language(erlang). -export([init/1,stateChange/3,monitorType/0]). -include("state.hrl"). -include("process.hrl"). -include("node.hrl"). -include("stackEntry.hrl"). -behaviour(mce_behav_monitor). monitorType() -> safety. init...
null
https://raw.githubusercontent.com/fredlund/McErlang/25b38a38a729fdb3c3d2afb9be016bbb14237792/examples/Elevator/src/stop_after_relevant_order.erl
erlang
@doc
@author 2006 - 2009 @private -module(stop_after_relevant_order). -language(erlang). -export([init/1,stateChange/3,monitorType/0]). -include("state.hrl"). -include("process.hrl"). -include("node.hrl"). -include("stackEntry.hrl"). -behaviour(mce_behav_monitor). monitorType() -> safety. init(State) ...
b9a99a56730e1fa18f730d9f998dd4f92a9d65ee3744850033072dcb254b9d35
florence/cover
provide.rkt
#lang racket/base (provide test (struct-out tt)) (define test 5) (struct tt (a b c) #:transparent)
null
https://raw.githubusercontent.com/florence/cover/bc17e4e22d47b1da91ddaa5eafefe28f4675e85c/cover-test/cover/tests/provide.rkt
racket
#lang racket/base (provide test (struct-out tt)) (define test 5) (struct tt (a b c) #:transparent)
7b5b3fdb0988efa17fda6f3108b45a72b3060ecc6dd437b548c3a9bf5e655264
anurudhp/CPHaskell
1070.hs
-- / import Control.Arrow ((>>>)) import Data.Maybe (fromMaybe) main :: IO () main = interact $ words >>> head >>> read >>> solve >>> fmap (unwords . map show) >>> fromMaybe "NO SOLUTION" solve :: Int -> Maybe [Int] solve n | n == 1 = Just [1] | n <= 3 = Nothing | otherwise = Just $ filter odd [5 .....
null
https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/cses/1070.hs
haskell
/
import Control.Arrow ((>>>)) import Data.Maybe (fromMaybe) main :: IO () main = interact $ words >>> head >>> read >>> solve >>> fmap (unwords . map show) >>> fromMaybe "NO SOLUTION" solve :: Int -> Maybe [Int] solve n | n == 1 = Just [1] | n <= 3 = Nothing | otherwise = Just $ filter odd [5 .. n] +...
05d7f24aee5ffc8e5612fefbc80e271fb52ee91de5b8b3a0a8526cae7caad7b5
Calsign/p5ml
math.ml
module Math = struct let pi = 2. *. Stdlib.asin 1. let half_pi = pi /. 2. let two_pi = pi *. 2. let e = Stdlib.exp 1. let abs = Stdlib.abs let absf = Stdlib.abs_float let ceil v = Stdlib.ceil v |> int_of_float let ceilf = Stdlib.ceil let floor v = Stdlib.floor v |> int_of_float let floorf = Stdli...
null
https://raw.githubusercontent.com/Calsign/p5ml/65a379a941a7c1c99e6d43fa4a171cd4d68d4e88/core/math.ml
ocaml
module Math = struct let pi = 2. *. Stdlib.asin 1. let half_pi = pi /. 2. let two_pi = pi *. 2. let e = Stdlib.exp 1. let abs = Stdlib.abs let absf = Stdlib.abs_float let ceil v = Stdlib.ceil v |> int_of_float let ceilf = Stdlib.ceil let floor v = Stdlib.floor v |> int_of_float let floorf = Stdli...
381d389bb5f1bb184c36d55fe4e5429d91d0fc6ae7e129bb181837c168ab4f75
snoyberg/why-you-should-use-stm
exercise.hs
#!/usr/bin/env stack -- stack --resolver lts-13.21 script -- This code doesn't compile, fix it! main :: IO () main = do putStrLn "Hello World" putStrLn "Goodbye!
null
https://raw.githubusercontent.com/snoyberg/why-you-should-use-stm/adf3366aebd6daf1dd702ed4cad1c2303d296afc/exercises/00-setup/exercise.hs
haskell
stack --resolver lts-13.21 script This code doesn't compile, fix it!
#!/usr/bin/env stack main :: IO () main = do putStrLn "Hello World" putStrLn "Goodbye!
33ef518176c87c2020e758df4c02f8b29cd58ef22d5ea6ca45d20676c5dc590f
paurkedal/iplogic
iplogic_diag.mli
Copyright ( C ) 2017 < > * * 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 p...
null
https://raw.githubusercontent.com/paurkedal/iplogic/7c56b5c55c03a681381fafb80220a5c0eba9f212/lib/iplogic_diag.mli
ocaml
Copyright ( C ) 2017 < > * * 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 p...
5daa18099850ebd3056e80f223055be52f487b9d325e515c14d9c7e173b04c46
facebook/infer
PulseModelsErlang.ml
* 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) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/facebook/infer/ca296e96a71aa96ed8b67f65219dd160ef99fbf7/infer/src/pulse/PulseModelsErlang.ml
ocaml
* Represents the result of a transfer function that may (a) nondeterministically split the state, and (b) some of the nondeterministic branches may be errors. Goes well with [let>] defined later in this file. * special case of {!maker} when the result is known to be satisfiable * Similar to {!maker} but can r...
* 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) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
831d14d01d6b00fa3977da745b6f552b736d9a2ece53453c80f44993173edcdb
racket/web-server
cookie.rkt
#lang racket/base (require net/cookies/common net/cookies/server web-server/http/request-structs racket/contract racket/match racket/date ) (provide (contract-out [cookie->header (-> cookie? header?)] [rename make-...
null
https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/http/cookie.rkt
racket
cookie->header : cookie -> header gets the header that will set the given cookie day month year
#lang racket/base (require net/cookies/common net/cookies/server web-server/http/request-structs racket/contract racket/match racket/date ) (provide (contract-out [cookie->header (-> cookie? header?)] [rename make-...
9de007878020ca1353fa63bb6d0cea23d130de0b8c75a82cd466da2de1ccd8fa
manetu/temporal-clojure-sdk
codec.clj
Copyright © 2022 , Inc. All rights reserved (ns temporal.codec "Methods for managing codecs between a client and the Temporal backend" (:require [clojure.core.protocols :as p] [clojure.datafy :as d] [medley.core :as m]) (:import [io.temporal.common.converter DefaultDataConverter Code...
null
https://raw.githubusercontent.com/manetu/temporal-clojure-sdk/4a349878922e7b4083b5bb90eb474a18ffd48200/src/temporal/codec.clj
clojure
Copyright © 2022 , Inc. All rights reserved (ns temporal.codec "Methods for managing codecs between a client and the Temporal backend" (:require [clojure.core.protocols :as p] [clojure.datafy :as d] [medley.core :as m]) (:import [io.temporal.common.converter DefaultDataConverter Code...
decb35ef94142da5fde3e6c6b1fd1129cf487ac02e889e989e2c7eb9a47705a0
SimulaVR/godot-haskell
VisualShaderNodeCustom.hs
# LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving , TypeFamilies , TypeOperators , FlexibleContexts , DataKinds , MultiParamTypeClasses # TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, MultiParamTypeClasses #-} module Godot.Core.VisualShaderNodeCustom (Godot.Core.VisualShaderNodeC...
null
https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/VisualShaderNodeCustom.hs
haskell
| Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. | Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is __required__. Defining this method i...
# LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving , TypeFamilies , TypeOperators , FlexibleContexts , DataKinds , MultiParamTypeClasses # TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, MultiParamTypeClasses #-} module Godot.Core.VisualShaderNodeCustom (Godot.Core.VisualShaderNodeC...
04cfd9ab045fe072384fed49abc2427ff8a5b814352e2b71979d82526ed985af
tqtezos/lorentz-contract-oracle
CmdLnArgs.hs
{-# OPTIONS -Wno-missing-export-lists -Wno-unused-do-bind -Wno-partial-fields -Wno-orphans #-} module Lorentz.Contracts.Oracle.CmdLnArgs where import Data.Char import Control.Applicative import Control.Monad import Text.Show (Show(..)) import Data.List import Data.Either import Data.Function (id, flip, const) import ...
null
https://raw.githubusercontent.com/tqtezos/lorentz-contract-oracle/bad8d949bde433d5de594955d4d0253611a3312f/src/Lorentz/Contracts/Oracle/CmdLnArgs.hs
haskell
# OPTIONS -Wno-missing-export-lists -Wno-unused-do-bind -Wno-partial-fields -Wno-orphans # | No `Notes` | Parse something in parentheses | Attempt to parse with given modifier, otherwise parse without | Attempt to parse `inParensP`, else parse without | Read an `Address`, inside or outside of @""@'s | Parse an `A...
module Lorentz.Contracts.Oracle.CmdLnArgs where import Data.Char import Control.Applicative import Control.Monad import Text.Show (Show(..)) import Data.List import Data.Either import Data.Function (id, flip, const) import Prelude (FilePath, runReaderT) import Data.String (String) import Data.Maybe import Data.Typeab...
26496e5c37fdd16aef29b71a550e381c96525324fc7b1556d6b2a6c065c18316
diku-dk/pfp-e2019-pub
sudoku3-final.hs
import Sudoku import Control.Exception import System.Environment import Control.Parallel.Strategies hiding (parMap) import Data.Maybe main :: IO () main = do [f] <- getArgs file <- readFile f let puzzles = lines file force IO before parallel solving let solutions = runEval (parMap solve puzzles) print...
null
https://raw.githubusercontent.com/diku-dk/pfp-e2019-pub/4b6ddcc73099708c0bfa4082f5e4f2a45484b2b2/slides/L5-parallel-haskell-code/sudoku3-final.hs
haskell
import Sudoku import Control.Exception import System.Environment import Control.Parallel.Strategies hiding (parMap) import Data.Maybe main :: IO () main = do [f] <- getArgs file <- readFile f let puzzles = lines file force IO before parallel solving let solutions = runEval (parMap solve puzzles) print...
7a67f8d29390269d2c0e2cd65c3b3843f9acc4bfc26a302446a1af1bddecaf04
SilentCircle/scpf
sc_push_top.erl
-module(sc_push_top). -export([info/0]). info() -> "This is just a placeholder to keep the release system happy.".
null
https://raw.githubusercontent.com/SilentCircle/scpf/68d46626a056cfd8234d3b6f4661d7d037758619/src/sc_push_top.erl
erlang
-module(sc_push_top). -export([info/0]). info() -> "This is just a placeholder to keep the release system happy.".
c4f33fe6c8e29f2c668cca2bb07dfb8beeee5c8a70e2f61b770138991e73f396
Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library
CheckoutAcssDebitPaymentMethodOptions.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 CheckoutAcssDebitPaymentMethodOptions module StripeAPI.Types.CheckoutAcssDe...
null
https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/CheckoutAcssDebitPaymentMethodOptions.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # | Contains the types generated from the schema CheckoutAcssDebitPaymentMethodOptions # SOURCE # | Defines the object schema located at @components.schemas.checkout_acss_debit_payment_method_options@ in the specification. | mandate_options: | setup_future_usage:...
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator . module StripeAPI.Types.CheckoutAcssDebitPaymentMethodOptions where import qualified Control.Monad.Fail import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Inter...
b3d6e3cf0c4c8c1c23efdcbafafef20e2a2033c42d57de2645b67afcce6e5332
geophf/1HaskellADay
Exercise.hs
{-# LANGUAGE OverloadedStrings #-} module Y2020.M10.D13.Exercise where - Yesterday , we translated the results of a SPARQL query into a set of AirBase values . Today , let 's examine these data in a graph database . Let 's look at the relationship between airbases and countries today . ... no . I 'm stil...
null
https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2020/M10/D13/Exercise.hs
haskell
# LANGUAGE OverloadedStrings # } the rest of the Milky Way galaxy but Wikidata? NOOOOOOOOO! ... and if it were formatted as JSON (and not as JSON-as-a-string) it wouldn't be a problem ... AT ALL ... but was it? I ASK YOU! whew! I feel much better now. Thank you.
module Y2020.M10.D13.Exercise where - Yesterday , we translated the results of a SPARQL query into a set of AirBase values . Today , let 's examine these data in a graph database . Let 's look at the relationship between airbases and countries today . ... no . I 'm still unhappy that I had to write a par...
b7084530bc98e14157c55d5f26b2194cdb24e2ee55ff7c0e71b441e935e30844
walmartlabs/lacinia-pedestal
pedestal_test.clj
Copyright ( c ) 2017 - present Walmart , Inc. ; 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 or agreed to in writing, software dist...
null
https://raw.githubusercontent.com/walmartlabs/lacinia-pedestal/e70f853ff96ac2c8f315bc5a6d429213df0c5d04/test/com/walmartlabs/lacinia/pedestal_test.clj
clojure
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 ) 2017 - present Walmart , Inc. Licensed under the Apache License , Version 2.0 ( the " License " ) distributed under the License is distributed on an " AS IS " BASIS , (ns com.walmartlabs.lacinia.pedestal-test (:require [clojure.test :refer [deftest is use-fixtures]] [com.walmartlabs.lac...
8f8725847f6068ca3ae73ee6b74b5f08f35cf6d41f4d91126b782acaf88ea00e
pgj/mirage-kfreebsd
clock.mli
* Copyright ( c ) 2010 - 2011 Anil Madhavapeddy < > * Copyright ( c ) 2012 * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . *...
null
https://raw.githubusercontent.com/pgj/mirage-kfreebsd/0ff5b2cd7ab0975e3f2ee1bd89f8e5dbf028b102/packages/mirage-platform/lib/clock.mli
ocaml
* Copyright ( c ) 2010 - 2011 Anil Madhavapeddy < > * Copyright ( c ) 2012 * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . *...
784cba170da104d8589ea7468a99f7a6d5fa4a4255c6571930da61dc44c6491b
ocsigen/js_of_ocaml
fannkuch_redux_2.ml
The Computer Language Benchmarks Game / contributed by , transliterated from Lua program / contributed by Isaac Gouy, transliterated from Mike Pall's Lua program *) let fannkuch n = let p = Array.make n 0 in let q = Array.make n 0 in let s = Array.make n 0 in let sign = ref 1 in le...
null
https://raw.githubusercontent.com/ocsigen/js_of_ocaml/58210fabc947c4839b6e71ffbbf353a4ede0dbb7/benchmarks/sources/ml/fannkuch_redux_2.ml
ocaml
The Computer Language Benchmarks Game / contributed by , transliterated from Lua program / contributed by Isaac Gouy, transliterated from Mike Pall's Lua program *) let fannkuch n = let p = Array.make n 0 in let q = Array.make n 0 in let s = Array.make n 0 in let sign = ref 1 in le...
71fcc3d0d56bfefbcf219d47a7fb06d42c4ceda0d1d9c3a222d7cf2baebb3b78
rescript-lang/rescript-compiler
js_closure.ml
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * Copyright ( C ) 2016 - , Authors of ReScript * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the...
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/core/js_closure.ml
ocaml
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * Copyright ( C ) 2016 - , Authors of ReScript * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the...
8df3f28e85c197b886a5b5d3089717b05e467e8233ffebe507f23457886d629d
Deep-Symmetry/afterglow
channels.clj
(ns afterglow.channels "Functions for modeling DMX channels" {:author "James Elliott"} (:require [afterglow.fixtures.qxf :refer [sanitize-name]] [camel-snake-kebab.core :as csk] [com.evocomputing.colors :as colors])) (defn channel "Creates a minimal channel specification, containing jus...
null
https://raw.githubusercontent.com/Deep-Symmetry/afterglow/12b8c90f22c591549adc4d89b8a19853f5e9e3a5/src/afterglow/channels.clj
clojure
resolves all of its resolves all of their channel assignments." resolves if you do not, the generic label `Level` will be this will be expanded into a Was not a sequence, so return a single function spec
(ns afterglow.channels "Functions for modeling DMX channels" {:author "James Elliott"} (:require [afterglow.fixtures.qxf :refer [sanitize-name]] [camel-snake-kebab.core :as csk] [com.evocomputing.colors :as colors])) (defn channel "Creates a minimal channel specification, containing jus...
437f6108a21976f8305e8a51d0718bd82ab5486ffc46952376b8872c56e36526
bsaleil/lc
etape1-println-int.scm
(println 31415926) (println 11) (println 10) (println 9) (println 1) (println 0) (println -1) (println -9) (println -10) (println -11) (println -31415926) 31415926 11 10 9 1 0 ;-1 -9 ;-10 ;-11 ;-31415926
null
https://raw.githubusercontent.com/bsaleil/lc/ee7867fd2bdbbe88924300e10b14ea717ee6434b/unit-tests/IFT3065/1/etape1-println-int.scm
scheme
-1 -10 -11 -31415926
(println 31415926) (println 11) (println 10) (println 9) (println 1) (println 0) (println -1) (println -9) (println -10) (println -11) (println -31415926) 31415926 11 10 9 1 0 -9
e34ebf3034f183dba814aa8b99d8da428343f0c5e5e20d0a6753b00dc094a11c
camllight/camllight
ouster-f16.2.ml
#open "tk";; let top = OpenTk() in let lb = label__create top [Bitmap (BitmapFile "/usr/local/lib/tk/scripts/demos/bitmaps/flagdown")] and ll = label__create top [Text "No new mail"] in pack [lb; ll] []; MainLoop() ;;
null
https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk/books-examples/ouster-f16.2.ml
ocaml
#open "tk";; let top = OpenTk() in let lb = label__create top [Bitmap (BitmapFile "/usr/local/lib/tk/scripts/demos/bitmaps/flagdown")] and ll = label__create top [Text "No new mail"] in pack [lb; ll] []; MainLoop() ;;
7d9685ca3789ad3d3796e65692c79af18ee71a00575a83827b73cffb797f3f75
CrossRef/cayenne
prefix.clj
(ns cayenne.tasks.prefix (:require [clj-http.client :as client] [cayenne.xml :as xml] [cayenne.conf :as conf] [clojure.core.memoize :as memoize]) (:use [cayenne.util]) (:import [java.io StringReader])) ;; todo unixref oai parser should extract owner prefix. (defn parse-prefix...
null
https://raw.githubusercontent.com/CrossRef/cayenne/02321ad23dbb1edd3f203a415f4a4b11ebf810d7/src/cayenne/tasks/prefix.clj
clojure
todo unixref oai parser should extract owner prefix.
(ns cayenne.tasks.prefix (:require [clj-http.client :as client] [cayenne.xml :as xml] [cayenne.conf :as conf] [clojure.core.memoize :as memoize]) (:use [cayenne.util]) (:import [java.io StringReader])) (defn parse-prefix-info [xml] (let [location (.trim (xml/xselect1 xml :>...
7446f8cfac2a559313be350f697cadc56bfe175cd730a6b7fe559ee9bc28dbc4
fiddlerwoaroof/cl-git
model.lisp
(in-package :fwoar.cl-git) (defparameter *object-data-lens* (data-lens.lenses:make-alist-lens :object-data)) (defclass pack () ((%pack :initarg :pack :reader pack-file) (%index :initarg :index :reader index-file) (%repository :initarg :repository :reader repository))) (defclass repository () ((%root :ini...
null
https://raw.githubusercontent.com/fiddlerwoaroof/cl-git/fb9deed060d49dbb52f390f67b1783a13edf71b6/model.lisp
lisp
TODO: figure out how to handle ambiguity? restarts?
(in-package :fwoar.cl-git) (defparameter *object-data-lens* (data-lens.lenses:make-alist-lens :object-data)) (defclass pack () ((%pack :initarg :pack :reader pack-file) (%index :initarg :index :reader index-file) (%repository :initarg :repository :reader repository))) (defclass repository () ((%root :ini...
08d6f948bfd15a830070e575e702f2c5f846bfcfb09cb4952d689c2c04f9f0f9
antono/guix-debian
sync-descriptions.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2013 < > ;;; ;;; 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 the Lice...
null
https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/build-aux/sync-descriptions.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 © 2013 < > 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 < / > . (use-modules (guix gnu-maintenance) (guix packages) (guix utils) (guix ui)...
46cf9d3bf2730834934e04728ff663a76477e1d58357896e5f9d65e27fef6c04
gentoo-haskell/hackport
Utils.hs
{-| Module : Merge.Utils License : GPL-3+ Maintainer : Internal helper functions for "Merge". -} module Merge.Utils ( readPackageString , getPreviousPackageId , first_just_of , drop_prefix , squash_debug , convert_underscores , mangle_iuse , to_unstable , metaFlags , dropIfUseExpands h...
null
https://raw.githubusercontent.com/gentoo-haskell/hackport/d0e57e8dd86731fa416422fe68720f7a994694f1/src/Merge/Utils.hs
haskell
| Module : Merge.Utils License : GPL-3+ Maintainer : Internal helper functions for "Merge". | Parse a 'String' as a valid package string. E.g. @category\/name-1.0.0@. Return 'HackPortError' if the string to parse is invalid. When the 'String' is valid: >>> readPackageString "dev-haskell/packagename1-...
module Merge.Utils ( readPackageString , getPreviousPackageId , first_just_of , drop_prefix , squash_debug , convert_underscores , mangle_iuse , to_unstable , metaFlags , dropIfUseExpands hspec exports , dropIfUseExpand ) where import qualified Control.Applicative as A import qualified Contro...
07cba01eba431c4e19937ff2f38e50c88b906ebb053fa93a9cf29cb5b5a9c58c
incoherentsoftware/defect-process
Level.hs
module Configs.All.Level ( LevelConfig(..) ) where import Data.Aeson.Types (FromJSON, genericParseJSON, parseJSON) import GHC.Generics (Generic) import qualified Data.List.NonEmpty as NE import Enemy.LockOnReticleData import Level.Room.ArenaWalls.EnemySpawn.Types import Level.Room.ArenaWalls.JSON import L...
null
https://raw.githubusercontent.com/incoherentsoftware/defect-process/14ec46dec2c48135bc4e5965b7b75532ef19268e/src/Configs/All/Level.hs
haskell
module Configs.All.Level ( LevelConfig(..) ) where import Data.Aeson.Types (FromJSON, genericParseJSON, parseJSON) import GHC.Generics (Generic) import qualified Data.List.NonEmpty as NE import Enemy.LockOnReticleData import Level.Room.ArenaWalls.EnemySpawn.Types import Level.Room.ArenaWalls.JSON import L...
bd9c793429493a9751f6cc134774e047e075f8c5b143b83ac16cbb1b29573e0b
NorfairKing/sydtest
HspecSpec.hs
module Test.Syd.HspecSpec (spec) where import Control.Concurrent.STM import Test.Hspec as Hspec import Test.Hspec.QuickCheck as Hspec import qualified Test.Syd as Syd import qualified Test.Syd.Hspec as Syd spec :: Syd.Spec spec = Syd.fromHspec exampleHspecSpec exampleHspecSpec :: Hspec.Spec exampleHspecSpec = do i...
null
https://raw.githubusercontent.com/NorfairKing/sydtest/1ecd8084b5a7eb0266a654ed0e5e90b6ba170c58/sydtest-hspec/test/Test/Syd/HspecSpec.hs
haskell
module Test.Syd.HspecSpec (spec) where import Control.Concurrent.STM import Test.Hspec as Hspec import Test.Hspec.QuickCheck as Hspec import qualified Test.Syd as Syd import qualified Test.Syd.Hspec as Syd spec :: Syd.Spec spec = Syd.fromHspec exampleHspecSpec exampleHspecSpec :: Hspec.Spec exampleHspecSpec = do i...
702851701baba5a05f9bb8be39468c9df90c733302d7723c775e73e6d37f3d89
erlangonrails/devdb
core_vnode_eqc.erl
%% ------------------------------------------------------------------- %% core_vnode_eqc : QuickCheck tests for riak_core_vnode code %% Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved . %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may n...
null
https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak_core/test/core_vnode_eqc.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 permissi...
core_vnode_eqc : QuickCheck tests for riak_core_vnode code Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. 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 ...
f240430651f3688ffc90fdef709fcaa5d9c8fb3391e566135f0357f018e3325a
Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library
PortalBusinessProfile.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 PortalBusinessProfile module StripeAPI.Types.PortalBusinessProfile where i...
null
https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PortalBusinessProfile.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # | Contains the types generated from the schema PortalBusinessProfile | headline: The messaging shown to customers in the portal. Constraints: | privacy_policy_url: A link to the business’s publicly available privacy policy. Constraints: | terms_of_service...
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator . module StripeAPI.Types.PortalBusinessProfile where import qualified Control.Monad.Fail import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Internal import quali...
88b96bb23603508b4ab26f4e7224651e1f0b23b758bb25991065d0a17452a6ab
wdebeaum/step
rpm.lisp
;;;; ;;;; W::RPM ;;;; (define-words :pos W::n :templ COUNT-PRED-TEMPL :words ( (W::RPM (SENSES ((LF-PARENT ONT::frequency-unit) (TEMPL other-reln-TEMPL) (META-DATA :ORIGIN CALO :ENTRY-DATE 20040204 :CHANGE-DATE NIL :wn ("rpm%1:28:00") :COMMENTS HTML-PURCHASING-CORPUS)))) ))
null
https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/rpm.lisp
lisp
W::RPM
(define-words :pos W::n :templ COUNT-PRED-TEMPL :words ( (W::RPM (SENSES ((LF-PARENT ONT::frequency-unit) (TEMPL other-reln-TEMPL) (META-DATA :ORIGIN CALO :ENTRY-DATE 20040204 :CHANGE-DATE NIL :wn ("rpm%1:28:00") :COMMENTS HTML-PURCHASING-CORPUS)))) ))
4a35b7ae9bff49767cac7d70203f923070fe90e39f475d65a3e9ef48faa86d00
screenshotbot/screenshotbot-oss
test-populate.lisp
;;;; Copyright 2018-Present Modern Interpreters Inc. ;;;; This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. (defpackage :screenshotbot/login/test-populate (:use #:cl #:fiveam) (:imp...
null
https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/02348d8e1a621e68be2d9b2410076575dc77b64f/src/screenshotbot/login/test-populate.lisp
lisp
Copyright 2018-Present Modern Interpreters Inc.
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. (defpackage :screenshotbot/login/test-populate (:use #:cl #:fiveam) (:import-from #:screenshotbot/login/populate #:...
8d8677fbe2311fa09419994148613107b1f31942a2d93c7df9ecd7a086cddd75
kazzmir/master-of-magic
windows.ml
module WindowManager = struct class point (_x:int) (_y:int) = object(self) val x = _x; val y = _y; method getX = x; method getY = y; end;; class dimension (_width:int) (_height:int) = object(self) val width = _width; val height = _height; method getWidth = width; method getHeight = height; end;; ...
null
https://raw.githubusercontent.com/kazzmir/master-of-magic/830bfd1c549a5ac7370fa6a72bb06be5d3435fa0/ocaml/windows.ml
ocaml
time, button, x, y time, button, x, y time, button, x, y key code key code time, button, x, y time, x, y time, x, y key code implements event handler functions model view controller using `and' here makes the types mutually recursive val mutable widgets : widget list = [] val mutable curre...
module WindowManager = struct class point (_x:int) (_y:int) = object(self) val x = _x; val y = _y; method getX = x; method getY = y; end;; class dimension (_width:int) (_height:int) = object(self) val width = _width; val height = _height; method getWidth = width; method getHeight = height; end;; ...
8436734a6c0ba997187e53efbd7efa6f5fdc6ff30b717f4f2c63a4b8af8647f0
malcolmreynolds/GSLL
error-functions.lisp
Regression test ERROR - FUNCTIONS for GSLL , automatically generated (in-package :gsl) (LISP-UNIT:DEFINE-TEST ERROR-FUNCTIONS (LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 0.8427007929497149d0 7.789237746491556d-16) (MULTIPLE-VALUE-LIST (ERF 1.0d0)))...
null
https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/error-functions.lisp
lisp
Regression test ERROR - FUNCTIONS for GSLL , automatically generated (in-package :gsl) (LISP-UNIT:DEFINE-TEST ERROR-FUNCTIONS (LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 0.8427007929497149d0 7.789237746491556d-16) (MULTIPLE-VALUE-LIST (ERF 1.0d0)))...
ecbcd0c482312bcf1407866766d1ea3850aacee371f4e4900df68a1e7258f35f
danielholmes/wolf3d-haskell
Data.hs
module Wolf3D.Display.Data ( RenderData (..), WallRayHit (..), WallData, HitDirection (..), CIntRectangle, fieldOfView, screenHeight, screenWidth, actionAreaX, actionAreaY, actionWidth, actionHeight, halfActionWidth, halfActionHeight, actionArea, intRectPos, intRectX, intRec...
null
https://raw.githubusercontent.com/danielholmes/wolf3d-haskell/de934f657f1fb4351591448bb4e25aaa4923571f/src/Wolf3D/Display/Data.hs
haskell
module Wolf3D.Display.Data ( RenderData (..), WallRayHit (..), WallData, HitDirection (..), CIntRectangle, fieldOfView, screenHeight, screenWidth, actionAreaX, actionAreaY, actionWidth, actionHeight, halfActionWidth, halfActionHeight, actionArea, intRectPos, intRectX, intRec...
96c5d88eba7f386a012cca3f2a9b03d10a1a06c060672485b3b18f6b12bac3c9
bmeurer/ocaml-experimental
fileevent.ml
(***********************************************************************) (* *) MLTk , Tcl / Tk interface of Objective Caml (* *) , , and ...
null
https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/otherlibs/labltk/support/fileevent.ml
ocaml
********************************************************************* described in file LICENSE found in the...
MLTk , Tcl / Tk interface of Objective Caml , , and projet Cristal , INRIA Rocquencourt , Kyoto University RIMS Copyright 2002 Institut National de Recherche en Informatique et en Automatique and...
a761aaef814c354b9bb71c6781609345f6bb58faebd662f0f1012bc034593a3f
rmculpepper/scriblogify
run.rkt
Copyright 2011 - 2012 Released under the terms of the LGPL version 3 or later . ;; See the file COPYRIGHT for details. #lang racket/base (require racket/cmdline "main.rkt" (prefix-in setup: "run-setup.rkt")) (define (post args) (define pre? #f) (define build-dir #f) (define upload-profil...
null
https://raw.githubusercontent.com/rmculpepper/scriblogify/7771d00ce6101bd5d415b54134eb79c42b92f1ef/scriblogify/run.rkt
racket
See the file COPYRIGHT for details. ----
Copyright 2011 - 2012 Released under the terms of the LGPL version 3 or later . #lang racket/base (require racket/cmdline "main.rkt" (prefix-in setup: "run-setup.rkt")) (define (post args) (define pre? #f) (define build-dir #f) (define upload-profile #f) (define overwrite? #f) (defin...
4e512b63948024bd1270b434851f28d899adf376d77ee5189a8167ddb5a3bde2
jimcrayne/jhc
tc215.hs
# OPTIONS_GHC -fwarn - incomplete - patterns Test for trac # 366 The C2 case is impossible due to the types module ShouldCompile where data T a where C1 :: T Char C2 :: T Float exhaustive :: T Char -> Char exhaustive C1 = ' '
null
https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/regress/tests/1_typecheck/2_pass/ghc/uncat/tc215.hs
haskell
# OPTIONS_GHC -fwarn - incomplete - patterns Test for trac # 366 The C2 case is impossible due to the types module ShouldCompile where data T a where C1 :: T Char C2 :: T Float exhaustive :: T Char -> Char exhaustive C1 = ' '
d0f24f78311371cc43a6879cfa79fc1258157a8e92e442cac2cc10c0a07c4539
AccelerateHS/accelerate-llvm
State.hs
# LANGUAGE CPP # # LANGUAGE GeneralizedNewtypeDeriving # {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.Array.Accelerate.LLVM.State Copyright : [ 2014 .. 2020 ] The Accelerate Team -- License : BSD3 -- Maintainer : < > -- Stability : experimental Portability : non -...
null
https://raw.githubusercontent.com/AccelerateHS/accelerate-llvm/cf081587fecec23a19f68bfbd31334166868405e/accelerate-llvm/src/Data/Array/Accelerate/LLVM/State.hs
haskell
# OPTIONS_HADDOCK hide # | Module : Data.Array.Accelerate.LLVM.State License : BSD3 Stability : experimental library Execution state =============== state 'target'. | Extract the execution state: 'gets llvmTarget' We may want to introduce some way to actually shut this down if, for example, ...
# LANGUAGE CPP # # LANGUAGE GeneralizedNewtypeDeriving # Copyright : [ 2014 .. 2020 ] The Accelerate Team Maintainer : < > Portability : non - portable ( GHC extensions ) module Data.Array.Accelerate.LLVM.State where import Control.Concurrent ( fo...
310478522407a36636100efb7d9d0f619c36951523e93081f22c357f593a6a9b
locusmath/locus
object.clj
(ns locus.algebra.abelian.group.object (:require [locus.set.logic.core.set :refer :all] [locus.set.logic.limit.product :refer :all] [locus.set.logic.structure.protocols :refer :all] [locus.set.mapping.general.core.object :refer :all] [locus.set.copresheaf.structure.core...
null
https://raw.githubusercontent.com/locusmath/locus/b94caabdbec71294c8fb320887646ddf0312ef24/src/clojure/locus/algebra/abelian/group/object.clj
clojure
Commutative groups are Z-modules. Once all relevant module related libraries have been loaded abelian groups can be converted into Z-modules by using the to-module command. Identity and inverse elements The natural preorder on a commutative group is trivial and its condensation is the trivial monoid Products of ob...
(ns locus.algebra.abelian.group.object (:require [locus.set.logic.core.set :refer :all] [locus.set.logic.limit.product :refer :all] [locus.set.logic.structure.protocols :refer :all] [locus.set.mapping.general.core.object :refer :all] [locus.set.copresheaf.structure.core...
f7b2a6d4bc5a0e31709546d9c0e536e558a1a35ee79bdbc2c201e51576daa119
kyleburton/sandbox
net.cljs
Copyright ( c ) . All rights reserved . ;; The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ( -1.0.php ) ;; which can be found in the file epl-v10.html at the root of this distribution. ;; By using this software in any fashion, you are agreeing to be bound by ;; ...
null
https://raw.githubusercontent.com/kyleburton/sandbox/cccbcc9a97026336691063a0a7eb59293a35c31a/examples/clojurescript/om-tut/.repl/6045/clojure/browser/net.cljs
clojure
The use and distribution terms for this software are covered by the which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software....
Copyright ( c ) . All rights reserved . Eclipse Public License 1.0 ( -1.0.php ) (ns ^{:doc "Network communication library, wrapping goog.net. Includes a common API over XhrIo, CrossPageChannel, and Websockets." :author "Bobby Calderwood and Alex Redington"} clojure.browser.net (:require [clojure.brow...
5064f27738192a9acd008aa4017211bdb3f4ad03f0d0cca997f0c181713bcf7b
takikawa/tr-pfds
hood-melville.rkt
#lang typed/racket (provide filter remove head+tail build-queue Queue queue enqueue head tail empty empty? queue->list (rename-out [qmap map] [queue-andmap andmap] [queue-ormap ormap]) fold) (require scheme/match) (struct: (A) Reversing ([count : Integer]...
null
https://raw.githubusercontent.com/takikawa/tr-pfds/a08810bdfc760bb9ed68d08ea222a59135d9a203/pfds/queue/hood-melville.rkt
racket
Check for empty queue An empty queue Inserts an element into the queue Returns the rest of the queue similar to list map function similar to list map function. apply is expensive so using case-lambda in order to saperate the more common case similar to list foldr or foldl Queue constructor function similar to...
#lang typed/racket (provide filter remove head+tail build-queue Queue queue enqueue head tail empty empty? queue->list (rename-out [qmap map] [queue-andmap andmap] [queue-ormap ormap]) fold) (require scheme/match) (struct: (A) Reversing ([count : Integer]...
2a4db8c48214f4a4b2467b9af63287b9396763e9b2f964823330b90692f8bba5
racket/racket7
unconstrained-domain-arrow.rkt
#lang racket/base (require (for-syntax racket/base) "arrow-common.rkt" "blame.rkt" "guts.rkt" "prop.rkt" "misc.rkt") (provide (rename-out [_unconstrained-domain-> unconstrained-domain->])) (define-syntax (_unconstrained-domain-> stx) (syntax-case stx () [(_ rngs ......
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/racket/contract/private/unconstrained-domain-arrow.rkt
racket
#lang racket/base (require (for-syntax racket/base) "arrow-common.rkt" "blame.rkt" "guts.rkt" "prop.rkt" "misc.rkt") (provide (rename-out [_unconstrained-domain-> unconstrained-domain->])) (define-syntax (_unconstrained-domain-> stx) (syntax-case stx () [(_ rngs ......
eb8733416b0d11d591c9f4a7d4e2550a4fd9199dc2f1237e5055334ad874d573
Eduap-com/WordMat
dsterf.lisp
;;; Compiled by f2cl version: ( " f2cl1.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ " " f2cl2.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ " " f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ " " f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ " " f2cl5.l , v 95098eb54f13 2013/04/01 00:45:16 toy $...
null
https://raw.githubusercontent.com/Eduap-com/WordMat/83c9336770067f54431cc42c7147dc6ed640a339/Windows/ExternalPrograms/maxima-5.45.1/share/maxima/5.45.1/share/lapack/lapack/dsterf.lisp
lisp
Compiled by f2cl version: Using Lisp CMU Common Lisp snapshot-2013-11 (20E Unicode) Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t) (:coerce-assigns :as-needed) (:array-type ':array) (:array-slicing t) (:declare-common nil) (:float-format single-float))
( " f2cl1.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ " " f2cl2.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ " " f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ " " f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ " " f2cl5.l , v 95098eb54f13 2013/04/01 00:45:16 toy $ " " f2cl6.l , v 1d5cbacbb9...
0458e9dbc3153f9a12d20bea5d1dc1296281ab14b25f8f0cdc3e394ee7217cb7
tamarit/edd
roman_ok.erl
-module(roman_ok). -compile([export_all]). to_roman(0) -> []; to_roman(X) when X >= 1000 -> [$M | to_roman(X - 1000)]; to_roman(X) when X >= 100 -> digit(X div 100, $C, $D, $M) ++ to_roman(X rem 100); to_roman(X) when X >= 10 -> digit(X div 10, $X, $L, $C) ++ to_roman(X rem 10); to_roman(X) when X >= 1 -> dig...
null
https://raw.githubusercontent.com/tamarit/edd/867f287efe951bec6a8213743a218b86e4f5bbf7/examples/roman/roman_ok.erl
erlang
-module(roman_ok). -compile([export_all]). to_roman(0) -> []; to_roman(X) when X >= 1000 -> [$M | to_roman(X - 1000)]; to_roman(X) when X >= 100 -> digit(X div 100, $C, $D, $M) ++ to_roman(X rem 100); to_roman(X) when X >= 10 -> digit(X div 10, $X, $L, $C) ++ to_roman(X rem 10); to_roman(X) when X >= 1 -> dig...
f06b960659bb85b986a6ad752261f380daea6bc25ff0d365f024022b09ceb17c
tweag/ormolu
proc-forms1.hs
{-# LANGUAGE Arrows #-} foo0 f g x y = proc _ -> (| f (g -< (x, y)) |) foo1 f g h x = proc (y, z) -> (| test ( h f . h g -< y x . y z ) ( h g . h f -< y z . y x) |)
null
https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/value/function/arrow/proc-forms1.hs
haskell
# LANGUAGE Arrows #
foo0 f g x y = proc _ -> (| f (g -< (x, y)) |) foo1 f g h x = proc (y, z) -> (| test ( h f . h g -< y x . y z ) ( h g . h f -< y z . y x) |)
4723864dc9636d13b183354b427bfcee8b3b40d84ac67c9e85361595a764ecf9
ghcjs/ghcjs
gadt2.hs
# LANGUAGE ExplicitForAll , GADTs # -- Pattern match uses dictionaries bound higher up in the pattern module Main where data T = forall a. Integral a => T a f :: T -> Bool f (T 0) = True f (T n) = False g :: T -> Ordering g (T n) | n >= 3 = if n>3 then GT else EQ g (T n) = LT main = do print [f (T 0), f (T ...
null
https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/gadt/gadt2.hs
haskell
Pattern match uses dictionaries bound higher up in the pattern
# LANGUAGE ExplicitForAll , GADTs # module Main where data T = forall a. Integral a => T a f :: T -> Bool f (T 0) = True f (T n) = False g :: T -> Ordering g (T n) | n >= 3 = if n>3 then GT else EQ g (T n) = LT main = do print [f (T 0), f (T 1)] print [g (T 2), g (T 3), g (T 4)]
f4d81deea6606557e01df712dbfe2174eb5f218aac40206e3f8bf689da1d872f
kowainik/stan
FileInfo.hs
| Copyright : ( c ) 2020 Kowainik SPDX - License - Identifier : MPL-2.0 Maintainer : < > File ( or module ) specific information . Copyright: (c) 2020 Kowainik SPDX-License-Identifier: MPL-2.0 Maintainer: Kowainik <> File (or module) specific information. -} module Stan.FileInfo ( FileMap , Fil...
null
https://raw.githubusercontent.com/kowainik/stan/da36eac741466fe6f46dc3e56fca7806f8b41816/src/Stan/FileInfo.hs
haskell
| File specific information. | Return the list of pretty-printed extensions. | Check whether the given extension is disabled no info about extensions, consider it disabled
| Copyright : ( c ) 2020 Kowainik SPDX - License - Identifier : MPL-2.0 Maintainer : < > File ( or module ) specific information . Copyright: (c) 2020 Kowainik SPDX-License-Identifier: MPL-2.0 Maintainer: Kowainik <> File (or module) specific information. -} module Stan.FileInfo ( FileMap , Fil...
14de0a86ddbd6290ce9acf14a820c82a52eb8c6295f7511ff40d1b6579497f0f
dbuenzli/rresult
rresult.ml
--------------------------------------------------------------------------- Copyright ( c ) 2015 The rresult programmers . All rights reserved . Distributed under the ISC license , see terms at the end of the file . --------------------------------------------------------------------------- Copyright (...
null
https://raw.githubusercontent.com/dbuenzli/rresult/5324558067a391bf8827ee76d413399887030c2f/src/rresult.ml
ocaml
Results Composing results Error messages hints new lines Trapping unexpected exceptions Pretty-printing Predicates Converting Ignoring errors
--------------------------------------------------------------------------- Copyright ( c ) 2015 The rresult programmers . All rights reserved . Distributed under the ISC license , see terms at the end of the file . --------------------------------------------------------------------------- Copyright (...
3d32a7071222a0e1c31cfbeeb73dd121dba2844073e12efd30500eb746e82e96
byorgey/AoC
06.hs
import Control.Arrow import Data.List import Data.Ord main = interact ( (++"\n") . map pickCommon . transpose . lines ) For part 1 , use pickCommon = fst . minimumBy (comparing snd) . map (head &&& length) . group . sort
null
https://raw.githubusercontent.com/byorgey/AoC/30eb51eb41af9ca86b05de598a3a96d25bd428e3/2016/06/06.hs
haskell
import Control.Arrow import Data.List import Data.Ord main = interact ( (++"\n") . map pickCommon . transpose . lines ) For part 1 , use pickCommon = fst . minimumBy (comparing snd) . map (head &&& length) . group . sort
03e9cebdd222401b54f0279d204d532e07da4b0a74e7e1d2f2133f42710b9ffe
jayrbolton/coursework
2.6.hs
-- J Bolton Assignment 6 , quarter 2 import Control.Monad.State import Control.Monad.Writer import Data.List (unfoldr) 1 . fib n = take (n+1) $ f 0 1 where f y z = y : f z (y+z) fib' n = take (n+1) $ unfoldr (\(a,b) -> Just(a,(b,a+b))) (0,1) --sweet! 2 . fib'' n = 0:[evalState (f x) (0,1) | x <- [0..n-1]] ...
null
https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/computability_and_formal_languages/Haskell/hws/q2/2.6.hs
haskell
J Bolton sweet! I really want to try heapsort sometime (I've never done it), but don't think I have time Wow, that was much more of a brain bender than I expected
Assignment 6 , quarter 2 import Control.Monad.State import Control.Monad.Writer import Data.List (unfoldr) 1 . fib n = take (n+1) $ f 0 1 where f y z = y : f z (y+z) 2 . fib'' n = 0:[evalState (f x) (0,1) | x <- [0..n-1]] where f c = get >>= \(x,y) -> if (c > 0) then (put (y,x+y) >> (f (c-...
6cf4f4bd4ef6d92f088298df79fbabd40581a3977d9dd7b684905005c5be08fd
triffon/fp-2019-20
get last member.rkt
(define (list-ref2 list i) (cond ((< i 0) "not a valid i") (else (if (= i 0) (car list) (list-ref2 (cdr list) (- i 1)))))) (define (last xs) (list-ref2 xs (- (length xs) 1))) (last '(5 9 2)) (last '(1 8 6 2 3)) (last '(1))
null
https://raw.githubusercontent.com/triffon/fp-2019-20/7efb13ff4de3ea13baa2c5c59eb57341fac15641/exercises/computer-science-3/exercises/04.lists/solutions/get%20last%20member.rkt
racket
(define (list-ref2 list i) (cond ((< i 0) "not a valid i") (else (if (= i 0) (car list) (list-ref2 (cdr list) (- i 1)))))) (define (last xs) (list-ref2 xs (- (length xs) 1))) (last '(5 9 2)) (last '(1 8 6 2 3)) (last '(1))
1addeeaf06c6579cb5f7c4c3e9b740d9c62271c2184d077de30689c2134b1fa1
KestrelInstitute/Specware
Tests.lisp
(test-directories ".") (test ("Bug 0107 : Bogus Nil prints as []" :show "BogusNil" :output '(";;; Elaborating spec at $TESTDIR/BogusNil" (:optional "") "spec" (:optional "") "type NotList(a) = | Cons a * NotList(a) | Nil" (:optional "") "op bogus_nil: NotList(Nat) = Nil" (:o...
null
https://raw.githubusercontent.com/KestrelInstitute/Specware/2be6411c55f26432bf5c9e2f7778128898220c24/TestSuite/Bugs/Bug_0107/Tests.lisp
lisp
(test-directories ".") (test ("Bug 0107 : Bogus Nil prints as []" :show "BogusNil" :output '(";;; Elaborating spec at $TESTDIR/BogusNil" (:optional "") "spec" (:optional "") "type NotList(a) = | Cons a * NotList(a) | Nil" (:optional "") "op bogus_nil: NotList(Nat) = Nil" (:o...
3f6ec0c66748748ce9a3ff56f40a6f28b0f751e03e69119f093cbbb8a380ca97
zelark/AoC-2020
day_01.clj
(ns zelark.aoc-2020.day-01 (:require [clojure.java.io :as io] [clojure.string :as str])) ;; --- Day 1: Report Repair --- ;; (def input (slurp (io/resource "input_01.txt"))) (defn parse-input [input] (->> input (str/split-lines) (map #(Long/parseLong %)))) (defn part1 [numbers target] (first (f...
null
https://raw.githubusercontent.com/zelark/AoC-2020/5417c3514889eb02efc23f6be7d69e29fdfa0376/src/zelark/aoc_2020/day_01.clj
clojure
--- Day 1: Report Repair --- 82498112
(ns zelark.aoc-2020.day-01 (:require [clojure.java.io :as io] [clojure.string :as str])) (def input (slurp (io/resource "input_01.txt"))) (defn parse-input [input] (->> input (str/split-lines) (map #(Long/parseLong %)))) (defn part1 [numbers target] (first (for [[a & a-rest] (iterate next numbe...