_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 |
|---|---|---|---|---|---|---|---|---|
2ca56ed1ce85fec99ea7359659c8a601c8582246f4bc63f523e7ee4cd65418e2 | wireapp/wire-server | ScimUserTimesStore.hs | # LANGUAGE TemplateHaskell #
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , e... | null | https://raw.githubusercontent.com/wireapp/wire-server/a28c06f4096f35d5bdb4289b45abff2c51d354fa/services/spar/src/Spar/Sem/ScimUserTimesStore.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | # LANGUAGE TemplateHaskell #
Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
mo... |
8aa29ae1a5ec64c3604cd252dc757107c7c7016e12d6cb47f674943f7d3e74f5 | WorksHub/client | side_card.cljc | (ns wh.styles.side-card)
(def section "side_card__section--2t0P6")
(def section--centered "side_card__section--centered--y3Hp4")
(def tabs "side_card__tabs--1_q8c")
(def tabs__tab "side_card__tabs__tab--3fKDG")
(def section--with-tabs "side_card__section--with-tabs--1Rc5Q")
(def tabs__input "side_card__tabs__input--3Na... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/common/src/wh/styles/side_card.cljc | clojure | (ns wh.styles.side-card)
(def section "side_card__section--2t0P6")
(def section--centered "side_card__section--centered--y3Hp4")
(def tabs "side_card__tabs--1_q8c")
(def tabs__tab "side_card__tabs__tab--3fKDG")
(def section--with-tabs "side_card__section--with-tabs--1Rc5Q")
(def tabs__input "side_card__tabs__input--3Na... | |
cd6844556567471789859ef8b3114a6206218e7ef60bc7a3fc2663111b76b565 | camllight/camllight | textvariable.ml | #open "protocol";;
type textVariable == string
;;
let counter = ref 0
;;
let freelist = ref (set__empty compare_strings)
and memo = hashtblc__new 101
;;
(* Added a variable v referenced by widget w *)
let add w v =
let r =
try hashtblc__find memo w
with
Not_found ->
let r = ref (set__empty... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk4/libsupport/textvariable.ml | ocaml | Added a variable v referenced by widget w
Free a widget
Allocate a new variable | #open "protocol";;
type textVariable == string
;;
let counter = ref 0
;;
let freelist = ref (set__empty compare_strings)
and memo = hashtblc__new 101
;;
let add w v =
let r =
try hashtblc__find memo w
with
Not_found ->
let r = ref (set__empty compare_strings) in
hashtblc__add memo w r;
... |
3081f8d21e0f92445011e790b5b533920068415d3ca8e6908d379650506aa8f1 | haroldcarr/learn-haskell-coq-ml-etc | XTestUtils.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module XTestUtils where
import X0
------------------------------------------------------------------------------
import qualified Data.Set as Set
import Protolude
node0, node1, node2 :: NodeId
no... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/program-structure/2019-01-hc-example-based-on-adjointio-raft/test/XTestUtils.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
---------------------------------------------------------------------------- | # LANGUAGE NoImplicitPrelude #
module XTestUtils where
import X0
import qualified Data.Set as Set
import Protolude
node0, node1, node2 :: NodeId
node0 = "node0"
node1 = "node1"
node2 = "node2"
nodeIds :: NodeIds
nodeIds = Set.fromList [node0, node1, node2]
testConfigs :: [NodeConfig]
testConfi... |
e5438a12d343342571df40fb30603c338f8de33c67b70a640b80f83a6d4cc359 | malgo-lang/malgo | Match.hs | -- | パターンマッチのコンパイル
module Malgo.Desugar.Match (match, PatMatrix, patMatrix) where
import Control.Lens (At (at), Prism', has, over, (?=), _1)
import Data.HashMap.Strict qualified as HashMap
import Data.List qualified as List
import Data.Traversable (for)
import Koriel.Core.Syntax
import Koriel.Core.Syntax qualified as ... | null | https://raw.githubusercontent.com/malgo-lang/malgo/a2a91e82692a2797bceefe502e1c2602dee1b03d/src/Malgo/Desugar/Match.hs | haskell | | パターンマッチのコンパイル
を元にコメントを追加
各節のパターン列を行列に見立て、転置してmatchにわたし、パターンを分解する
例えば、{ f Nil -> f empty | f (Cons x xs) -> f x }の場合は、
[ [f, Nil], [f, Cons x xs] ] に見立て、
[ [f, f], [Nil, Cons x xs] ] に転置する
| パターンの転置行列
パターンマッチを分解し、switch-case相当の分岐で表現できるように変換する
| マッチ対象
| パターン(転置行列)
| righthand
| fail
Variable Rule
パターンの先頭が... | module Malgo.Desugar.Match (match, PatMatrix, patMatrix) where
import Control.Lens (At (at), Prism', has, over, (?=), _1)
import Data.HashMap.Strict qualified as HashMap
import Data.List qualified as List
import Data.Traversable (for)
import Koriel.Core.Syntax
import Koriel.Core.Syntax qualified as Core
import Koriel.... |
b6ede60ff633b506837244a9c0bf87c88adf9c484361bf444e17bc52f864bbd1 | ocaml-flambda/ocaml-jst | compilation_unit.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/7e5a626e4b4e12f1e9106564e1baba4d0ef6309a/utils/compilation_unit.mli | ocaml | ************************************************************************
OCaml
... | Pierre Chambart and , OCamlPro
and ,
Copyright 2014 - -2021 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
Handling of the names of compilation units , including associated "... |
b0ccd5e5e67c460e88d765dc5460174a72c6f74b6f22c05d1ae92c49cafc3266 | geophf/1HaskellADay | Exercise.hs | module Y2018.M03.D06.Exercise where
-
Okay , I 'm supposed to go into Chapter I.3 of " Introduction to Logic " by
and talk about existential vs universal quantification of variables today .
And I will talk about that , but not , as it turns out , today . Today I 'm going
to go off 's script of classical log... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M03/D06/Exercise.hs | haskell | }
^ is one approach , the other is --v
which one works better for you? Why?
okay, hot shot: express plus :: Int -> Int -> Int as a Fun-type.
what does the function plus return in the Fun-domain?
or, if you prefer:
numbers using your plus or plusA function?
nums generated at random.org
Now, how about the motherOf... | module Y2018.M03.D06.Exercise where
-
Okay , I 'm supposed to go into Chapter I.3 of " Introduction to Logic " by
and talk about existential vs universal quantification of variables today .
And I will talk about that , but not , as it turns out , today . Today I 'm going
to go off 's script of classical log... |
ce2ee4802555ad116ae3e2ceec78f2117e8eaa0fb01f517de9158d032a945743 | EduardoHi/jsyn | Spec.hs | # LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
-- |
module Main where
import Control.Monad
import qualified Data.Aeson as A
import qualified Data.Text as T
import qualified Data.HashMap.Strict as M
import Jsyn
import Test.Hspec
import Test.Hspec.Golden (defaultGolden)
| cstring little... | null | https://raw.githubusercontent.com/EduardoHi/jsyn/d537b41abc71ce2aedb8f9fd3a1fec13a8647c59/Spec.hs | haskell | # LANGUAGE OverloadedStrings #
|
equivalent to this jq filter: {key: (keys | .[]) } + .[]
TODO: This would fail with objects that share a key but have different fields
Can this be generic enough to not need the specific key names ?
fails, identity function is missing...
fails, can't infer values used as keys
fai... | # LANGUAGE NamedFieldPuns #
module Main where
import Control.Monad
import qualified Data.Aeson as A
import qualified Data.Text as T
import qualified Data.HashMap.Strict as M
import Jsyn
import Test.Hspec
import Test.Hspec.Golden (defaultGolden)
| cstring little helper to build in the DSL
cstring = ... |
795ef4524a25a454b4652c516cf9f300c27de78aba1fbd009a8306df957cb7b8 | isovector/ld52 | ParticleSpawner.hs | module Game.Objects.ParticleSpawner where
import Game.Objects.Particle
import Game.Common
particleSpawner :: V2 WorldPos -> ParticleType -> Object
particleSpawner pos pt
= onSpawn (mconcat
[ standardDeathResponse
, spawnResponse $ particleType pt pos
])
$ staticObject pos mempty mempty
particl... | null | https://raw.githubusercontent.com/isovector/ld52/157ee1f1eff8295e6e96c5b90539a5956b3a20a3/src/Game/Objects/ParticleSpawner.hs | haskell | module Game.Objects.ParticleSpawner where
import Game.Objects.Particle
import Game.Common
particleSpawner :: V2 WorldPos -> ParticleType -> Object
particleSpawner pos pt
= onSpawn (mconcat
[ standardDeathResponse
, spawnResponse $ particleType pt pos
])
$ staticObject pos mempty mempty
particl... | |
8834af170b9e3a6f1e549f0035be3d189f4c1e11841bb2e898dc846dd4cc2fdd | haguenau/wyrd | test.ml | open Curses
let () = ripoffline true
let w = initscr ()
let (wd, ncol) = get_ripoff ()
let ( ) = assert ( start_color ( ) )
let ( ) = assert ( init_pair 1 Color.red Color.white )
let () = assert (init_pair 1 Color.red Color.white)*)
let () = assert (cbreak ())
let () = assert (noecho ())
let () = assert (intrflush... | null | https://raw.githubusercontent.com/haguenau/wyrd/490ce39ad9ecf36969eb74b9f882f85a1ef14ba3/curses/test.ml | ocaml | let () = Hashtbl.iter (fun a (b,c) ->
print_string (a ^ "\t" ^ b ^ "\t" ^ c); print_newline ())
str_terminfo_variables | open Curses
let () = ripoffline true
let w = initscr ()
let (wd, ncol) = get_ripoff ()
let ( ) = assert ( start_color ( ) )
let ( ) = assert ( init_pair 1 Color.red Color.white )
let () = assert (init_pair 1 Color.red Color.white)*)
let () = assert (cbreak ())
let () = assert (noecho ())
let () = assert (intrflush... |
555306cd24d31f2fe751980d1803c3539e8aeeec1239083bdde1c5e9315bda1d | brendanhay/amazonka | InsightImpactGraphEdge.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-xray/gen/Amazonka/XRay/Types/InsightImpactGraphEdge.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
/See:/ 'newInsightImpactGraphEdge' smart constructor.
| Identifier of the edge. Unique within a service map.
|
Create a value of 'InsightImpactGraphEdge' with all optional fields omitted.
The following record fields are avai... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Mo... |
66009065d611cd934d9f0c55475e16fdc2b8d6ac96edccf10cfd9e7c72284818 | tomhanika/conexp-clj | util_test.clj | ;; Copyright ⓒ the conexp-clj developers; 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 LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bou... | null | https://raw.githubusercontent.com/tomhanika/conexp-clj/5e4c15697f06446f925f53d1d143528155d7dd3a/src/test/clojure/conexp/math/util_test.clj | clojure | Copyright ⓒ the conexp-clj developers; all rights reserved.
The use and distribution terms for this software are covered by the
which can be found in the file LICENSE 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 re... | Eclipse Public License 1.0 ( -1.0.php )
(ns conexp.math.util-test
(:use conexp.math.util)
(:use clojure.test))
(deftest test-binomial-coefficient
(is (= 2203961430
(binomial-coefficient 34 18))))
(deftest test-eval-polynomial
(is (= 100
(eval-polynomial
(take 100 (repeat 1))
... |
da00c7d0a29a24f2f331392772f375f58dc9aee3d1e99eed945ef52a92bf1271 | myuon/minilight | MiniLight.hs | | MiniLight module exports all basic concepts and oprations except for concrete components .
-}
# LANGUAGE FunctionalDependencies #
module MiniLight (
module MiniLight.Light,
module MiniLight.Event,
module MiniLight.Figure,
module MiniLight.Component,
module MiniLight.Loader,
runLightT,
runLightTWith,
... | null | https://raw.githubusercontent.com/myuon/minilight/3c6a4f6b9ed15c97c7de02a281c31152442fb4d7/src/MiniLight.hs | haskell | | Run a light monad with default configuration.
@
runLightT = runLightTWith defLightConfig
@
| Custom configuration for LightT
Set False if you don't need graphical user interface (mostly for testing)
| Default configuration for 'runLightT'
| Run a Light monad.
| Use 'defConfig' for a default setting.
^ The d... | | MiniLight module exports all basic concepts and oprations except for concrete components .
-}
# LANGUAGE FunctionalDependencies #
module MiniLight (
module MiniLight.Light,
module MiniLight.Event,
module MiniLight.Figure,
module MiniLight.Component,
module MiniLight.Loader,
runLightT,
runLightTWith,
... |
70c1500efef1e32cb08ae62f204c2415d9fa1d686fa69425e94e23e9b0abcff6 | ijvcms/chuanqi_dev | player_black_lib.erl | %%%-------------------------------------------------------------------
@author yubing
( C ) 2015 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 11 . 十二月 2015 11:24
%%%-------------------------------------------------------------------
-module(player_black_lib).
-include("common.hrl").
-include("record.hrl").
-in... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/relationship/player_black_lib.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
获取黑名单列表
删除黑名单信息
添加黑名单 | @author yubing
( C ) 2015 , < COMPANY >
Created : 11 . 十二月 2015 11:24
-module(player_black_lib).
-include("common.hrl").
-include("record.hrl").
-include("config.hrl").
-include("cache.hrl").
-include("db_record.hrl").
-include("proto.hrl").
-include("gameconfig_config.hrl").
-include("language_config.hrl").
-... |
dc0b58ad18182028fc13b68a574a2b2752eb53a7ac4e55a3648e2c0f00f4645a | clingen-data-model/genegraph | types.clj | (ns genegraph.transform.types
(:require [genegraph.env :as env]
[io.pedestal.log :as log]))
(defmulti add-model :genegraph.transform.core/format)
(defmulti add-model-jsonld
"Turn model into JSON-LD string. Takes an event and returns it with :genegraph.annotate/jsonld.
Uses transform format to dispa... | null | https://raw.githubusercontent.com/clingen-data-model/genegraph/5c8053078e230c6eb7376a903cbb0428b3f835a9/src/genegraph/transform/types.clj | clojure | (ns genegraph.transform.types
(:require [genegraph.env :as env]
[io.pedestal.log :as log]))
(defmulti add-model :genegraph.transform.core/format)
(defmulti add-model-jsonld
"Turn model into JSON-LD string. Takes an event and returns it with :genegraph.annotate/jsonld.
Uses transform format to dispa... | |
801c45a026b9f1297aed86725c8bf61627f83dc31a0c24051c08566e590e3049 | sarabander/p2pu-sicp | 2.19.scm |
;; From the book:
(define us-coins (list 50 25 10 5 1))
(define uk-coins (list 100 50 20 10 5 2 1 0.5))
(define (cc amount coin-values)
(cond ((= amount 0) 1)
((or (< amount 0) (no-more? coin-values)) 0)
(else
(+ (cc amount
(except-first-denomination coin-values))
(cc (- amount
(first-denomination ... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/2.2/2.19.scm | scheme | From the book:
---------------
We reverse the order of coin lists
We now randomly change the ordering
Doesn't affect the result because of commutativity of addition.
In other words, when a node is the sum of its sub-branches, the ordering
of the branches doesn't matter. |
(define us-coins (list 50 25 10 5 1))
(define uk-coins (list 100 50 20 10 5 2 1 0.5))
(define (cc amount coin-values)
(cond ((= amount 0) 1)
((or (< amount 0) (no-more? coin-values)) 0)
(else
(+ (cc amount
(except-first-denomination coin-values))
(cc (- amount
(first-denomination coin-values))
co... |
b7f4c7d8574de7179c24e79c9ecded9cd3133a475b2fb0c535bf5e76c6965ab3 | cil-project/cil | cilutil.ml |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions... | null | https://raw.githubusercontent.com/cil-project/cil/936b04103eb573f320c6badf280e8bb17f6e7b26/src/cilutil.ml | ocaml | Keep here the globally-visible flags
Whether to check CIL
If doCheck is true and warnings are found,
* treat them as errors.
when 'sliceGlobal' is set, then when 'rmtmps' runs, only globals
marked with #pragma cilnoremove(whatever) are kept; when used with
cilly.asm.exe, the ef... |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions... |
f95c3c4b9d10c69e1225f5302a335015705f0fc8444fb956d2757df6a2a238f6 | WhatsApp/power_shell | power_shell_default_SUITE.erl | %%%-------------------------------------------------------------------
@author < >
( c ) WhatsApp Inc. and its affiliates . All rights reserved .
@private
%%%-------------------------------------------------------------------
-module(power_shell_default_SUITE).
-author("").
%%--------------------------------... | null | https://raw.githubusercontent.com/WhatsApp/power_shell/6223b21f44bb178141119998d6b6e875de00fdc3/test/power_shell_default_SUITE.erl | erlang | -------------------------------------------------------------------
-------------------------------------------------------------------
--------------------------------------------------------------------
Common Test headers
Include stdlib header to enable ?assert() for readable output
test injected:
ensure 'old'... | @author < >
( c ) WhatsApp Inc. and its affiliates . All rights reserved .
@private
-module(power_shell_default_SUITE).
-author("").
-export([all/0,
suite/0,
init_per_suite/1,
end_per_suite/1,
init_per_testcase/2,
end_per_testcase/2]).
-export([inject/0, inject/1,
already/0, already... |
44565e5595d886189b4e2d484d457eaea410f93a5bb406ac3371b597354434f3 | ardumont/haskell-lab | AbstractMachine.hs | module AbstractMachine where
data Expr = Val Int | Add Expr Expr | Mult Expr Expr deriving Show
value:: Expr -> Int
value (Val n) = n
value (Mult x y) = value x + value y
value (Add x y) = value x + value y
* AbstractMachine > value ( Mult ( Val 10 ) ( Val 5 ) )
15
* AbstractMachine > value ( Add ( Val 10 ) ... | null | https://raw.githubusercontent.com/ardumont/haskell-lab/6d1f130300f33dc982c9a6b5d0b6a63af2c2666d/src/AbstractMachine.hs | haskell | module AbstractMachine where
data Expr = Val Int | Add Expr Expr | Mult Expr Expr deriving Show
value:: Expr -> Int
value (Val n) = n
value (Mult x y) = value x + value y
value (Add x y) = value x + value y
* AbstractMachine > value ( Mult ( Val 10 ) ( Val 5 ) )
15
* AbstractMachine > value ( Add ( Val 10 ) ... | |
35e72134777c84baa631b63e188b076bb7e4f0d6c1d3e34111925c30afe4a8a6 | kivra/ehtmltopdf | ehtmltopdf_bb_driver.erl | %%------------------------------------------------------------------------------
Copyright ( c ) 2012 KIVRA
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction , includ... | null | https://raw.githubusercontent.com/kivra/ehtmltopdf/e3d88161d91afbbd01fab58802e2bef255744fdb/src/ehtmltopdf_bb_driver.erl | erlang | ------------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furn... | Copyright ( c ) 2012 KIVRA
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIA... |
2e61e68aee02af548b8de83871f067c6fee011405b6562f0ba852e5721a2d8e5 | binsec/haunted | criteriaAsDefault.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
(* VERIMAG... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/dynamic/dse/path_exploration/criteriaAsDefault.ml | ocaml | ************************************************************************
VERIMAG
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
Lesser General Public License as published by the Free Software
Foundation , version 2.1 .
See the GNU Le... |
66d01b80e48b6fa89b195d159930cdd61c56f1d783c2f8ee9934fa5b3c018d56 | erlang/rebar3 | rebar_prv_deps.erl | -module(rebar_prv_deps).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-include("rebar.hrl").
-define(PROVIDER, deps).
-define(DEPS, [install_deps]).
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
State1 = rebar_state:add_provider(
State,
... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/src/rebar_prv_deps.erl | erlang | removed from rebar.config
This Dep is not in rebar.config but in rebar.lock
Dep is a checkout
Dep exists only in lock file
Dep not locked, report whether the disk copy matches the Source
Dep locked, install_deps provider should have had updated the disk copy with
the locked version
dep locked with mismatching l... | -module(rebar_prv_deps).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-include("rebar.hrl").
-define(PROVIDER, deps).
-define(DEPS, [install_deps]).
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
State1 = rebar_state:add_provider(
State,
... |
8cd7fd9279b71a5e68f063726a081d6a450f8540899af6b0b4a9bf283e312ec3 | donatello/minio-hs-archived | listObjects.hs | #!/usr/bin/env stack
stack --resolver runghc --package minio - hs
{-# Language OverloadedStrings #-}
import Network.Minio
import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as CC
import Prelude
| The following example uses 's play server at
-- :9000. The endpoint... | null | https://raw.githubusercontent.com/donatello/minio-hs-archived/c808dc1be2a5b15c2c714c0052f1d6a7bc98a809/examples/listObjects.hs | haskell | resolver runghc --package minio - hs
# Language OverloadedStrings #
:9000. The endpoint and associated
Performs a recursive listing of all objects under bucket "test"
on play.minio.io. | #!/usr/bin/env stack
import Network.Minio
import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as CC
import Prelude
| The following example uses 's play server at
credentials are provided via the libary constant ,
> minioPlayCI : : ConnectInfo
main :: IO ()
main =... |
5a487b4748a16f1ffc8938102eee034c2cb8d0e0d6959cbb02df351a3d21a5a8 | kaos/ecapnp | ecapnp_set_tests.erl | %%
Copyright 2013 , < >
%%
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
dis... | null | https://raw.githubusercontent.com/kaos/ecapnp/f351c07730ba134b41b137dd6a6b93069a0908fc/test/ecapnp_set_tests.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 gov... | Copyright 2013 , < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(ecapnp_set_tests).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-include("include/ecapnp.hrl").
root_test() ->
{ok, Root} ... |
888206446808843121d2f662b63303f489a4a68fe0ac83de4d6d163e6de8eea7 | GaloisInc/daedalus | Env.hs | module Daedalus.Interp.Env where
import Data.Map (Map)
import qualified Data.Map as Map
import RTS.ParseError
import RTS.Parser
import RTS.ParserAPI
import qualified Daedalus.AST as K
import Daedalus.Type.AST(TVar,TCTyName, TCTyDecl,TCName, Name, tcName)
import Daedalus.Value
import Daedalus.Interp.DebugAnnot
type ... | null | https://raw.githubusercontent.com/GaloisInc/daedalus/3f180d29441960e35386654ec79a2b205bddc157/src/Daedalus/Interp/Env.hs | haskell | ^ Bindings for polymorphic type argumens
^ Used for bitdata (for coercion) | module Daedalus.Interp.Env where
import Data.Map (Map)
import qualified Data.Map as Map
import RTS.ParseError
import RTS.Parser
import RTS.ParserAPI
import qualified Daedalus.AST as K
import Daedalus.Type.AST(TVar,TCTyName, TCTyDecl,TCName, Name, tcName)
import Daedalus.Value
import Daedalus.Interp.DebugAnnot
type ... |
6f3d6becb41d1b93e98ae96f5ea48051a68798ce22c3f0a81bd07aa176cc2b14 | MyDataFlow/ttalk-server | ejabberd_gen_mam_prefs.erl | -module(ejabberd_gen_mam_prefs).
-callback get_behaviour(Default :: mod_mam:archive_behaviour(),
Host :: ejabberd:server(), ArcID :: mod_mam:archive_id(),
LocJID :: ejabberd:jid(), RemJID :: ejabberd:jid()) -> any().
-callback set_prefs(Result :: any(), Host :: ejabberd:server(),
ArcID :: mod_... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/apps/ejabberd/src/ejabberd_gen_mam_prefs.erl | erlang | -module(ejabberd_gen_mam_prefs).
-callback get_behaviour(Default :: mod_mam:archive_behaviour(),
Host :: ejabberd:server(), ArcID :: mod_mam:archive_id(),
LocJID :: ejabberd:jid(), RemJID :: ejabberd:jid()) -> any().
-callback set_prefs(Result :: any(), Host :: ejabberd:server(),
ArcID :: mod_... | |
ac3f9e32b7c8a4df67b4cb980cc763dd202752da8a91500ebc156885b1d90a60 | mbj/stratosphere | ExcludedRuleProperty.hs | module Stratosphere.WAFv2.WebACL.ExcludedRuleProperty (
ExcludedRuleProperty(..), mkExcludedRuleProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ExcludedRul... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafv2/gen/Stratosphere/WAFv2/WebACL/ExcludedRuleProperty.hs | haskell | module Stratosphere.WAFv2.WebACL.ExcludedRuleProperty (
ExcludedRuleProperty(..), mkExcludedRuleProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ExcludedRul... | |
a16df4e505c90c30a36cfcd760de3b66811e18d66fd46159c9f9cdf85e4fa81d | LexiFi/dead_code_analyzer | deadArg.ml | (***************************************************************************)
(* *)
Copyright ( c ) 2014 - 2016 LexiFi SAS . All rights reserved .
(* *)
(* ... | null | https://raw.githubusercontent.com/LexiFi/dead_code_analyzer/c44dc2ea5ccb13df2145e9316e21c39f09dad506/src/deadArg.ml | ocaml | *************************************************************************
This source code is licensed under the MIT License
found in the LICENSE ... | Copyright ( c ) 2014 - 2016 LexiFi SAS . All rights reserved .
open Types
open Typedtree
open DeadCommon
let later = ref []
let last = ref []
let met = Hashtbl.create 512
let eom () =
List.iter (fun f -> f ()) !later;
later := [];
Hashtbl.reset met
let add lab expr loc last_loc nb_occur... |
a02c74c465f57ccbfcaef4c9fd9697d1f70abf8552b87b63dc974f716ce07727 | dmp1ce/DMSS | Common.hs | module Common where
import System.IO.Temp
import System.Environment
import DMSS.Config
withTemporaryTestDirectory :: FilePath -> (FilePath -> IO a) -> IO a
withTemporaryTestDirectory t f = withSystemTempDirectory t ( \s -> do
-- Change HOME environment variable to temporary directory
setEnv "HOME" s
Creat... | null | https://raw.githubusercontent.com/dmp1ce/DMSS/fd88690d97ed267e76f8345e6a76cd3727ef4efb/src-test/Common.hs | haskell | Change HOME environment variable to temporary directory
Run test | module Common where
import System.IO.Temp
import System.Environment
import DMSS.Config
withTemporaryTestDirectory :: FilePath -> (FilePath -> IO a) -> IO a
withTemporaryTestDirectory t f = withSystemTempDirectory t ( \s -> do
setEnv "HOME" s
Create local home directory for DMSS
createLocalDirectory
f ... |
c585876a7e9ea30ba93c76424f087ae5e56eb207cbb43f0313a66478bac74ab3 | ltoth/unison | uprintf.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ltoth/unison/e763510165e3d93c5140a4c5f2ea0dcbf5825a0c/ubase/uprintf.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 .
Modified for Unison
val fprintf: o... |
ab419c44645bf9cdc652aa08c942d5ffae43d7dfbd958fbc39f9ff66f2a5570d | jiesoul/soul-talk | events.cljs | (ns soul-talk.series.events
(:require [re-frame.core :refer [reg-event-db reg-event-fx]]
[ajax.core :refer [GET POST PATCH PUT DELETE]]
[soul-talk.db :refer [api-url]]
[clojure.string :as str]))
(reg-event-db
:series/init
(fn [db _]
(-> db
(assoc :series/delete-dialo... | null | https://raw.githubusercontent.com/jiesoul/soul-talk/630de08c6549b206d59023764d5f2576d97d1030/home/src/soul_talk/series/events.cljs | clojure | (ns soul-talk.series.events
(:require [re-frame.core :refer [reg-event-db reg-event-fx]]
[ajax.core :refer [GET POST PATCH PUT DELETE]]
[soul-talk.db :refer [api-url]]
[clojure.string :as str]))
(reg-event-db
:series/init
(fn [db _]
(-> db
(assoc :series/delete-dialo... | |
4de3b9f513739adaea925e7233db19712784f6ae08699d0224274f4ab591d8eb | graninas/Pragmatic-Type-Level-Design | Types.hs | module TCA1.Types where
import CPrelude
import qualified Data.Vector as V
type Idx = Int
type Coords = (Idx, Idx)
type Torus = Bool
type Expandable = Bool
data Dim2Board cell = Dim2Board
{ cells :: V.Vector (V.Vector cell)
, xSize :: Idx
, ySize :: Idx
-- , isTorus :: Torus
-- , isExpandable :: Expandabl... | null | https://raw.githubusercontent.com/graninas/Pragmatic-Type-Level-Design/54b346bd0949f5d89407fd02e9477e07d9f6cfdc/demo-apps/type-class-automaton1/src/TCA1/Types.hs | haskell | , isTorus :: Torus
, isExpandable :: Expandable | module TCA1.Types where
import CPrelude
import qualified Data.Vector as V
type Idx = Int
type Coords = (Idx, Idx)
type Torus = Bool
type Expandable = Bool
data Dim2Board cell = Dim2Board
{ cells :: V.Vector (V.Vector cell)
, xSize :: Idx
, ySize :: Idx
}
deriving Show
|
1b6f626f053c6ba0fba9d8cff50f312c4e37dca8c2de60c957329f04757b7b9c | geophf/1HaskellADay | Solution.hs | {-# LANGUAGE OverloadedStrings #-}
module Y2018.M08.D22.Solution where
import Data.Aeson
import Data.Aeson.Encode.Pretty (encodePretty)
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.List (isSuffixOf)
import Data.Map (Map)
import Data.Maybe (fromJust)
imp... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M08/D22/Solution.hs | haskell | # LANGUAGE OverloadedStrings #
what are the names of these JSON files?
}
-
>>> restructureJSON exDir (head files)
{
"entities": {
"farm fresh": {
"related_content": [
{
"uid": "d5642820-a9cf-5d9d-8c6f-06ebfdb7e573",
"weighted_score": 6.582... |
module Y2018.M08.D22.Solution where
import Data.Aeson
import Data.Aeson.Encode.Pretty (encodePretty)
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.List (isSuffixOf)
import Data.Map (Map)
import Data.Maybe (fromJust)
import Network.HTTP.Conduit
import Sy... |
ef4d2e0bb43e9181bca4f7348c9c894703d574d0c8e42cf098e104bb8165950a | unnohideyuki/bunny | sample178.hs | main =do print $ take 5 [n..]
print $ take 10 [n,(n-1)..]
print [1..(m-1)]
print [1,3..m]
where n = 9223372036854775807 * 2
m = 8
| null | https://raw.githubusercontent.com/unnohideyuki/bunny/501856ff48f14b252b674585f25a2bf3801cb185/compiler/test/samples/sample178.hs | haskell | main =do print $ take 5 [n..]
print $ take 10 [n,(n-1)..]
print [1..(m-1)]
print [1,3..m]
where n = 9223372036854775807 * 2
m = 8
| |
af33ff07cfe91ab4d9473e53966129c6ec06baf531aa3d6c988f030c2a2936b8 | imdea-software/leap | Response.mli |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/solvers/Response.mli | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
9cefc77d4c7b38c117f4b560ff799a30c5520d5daaf6ce00331b6494f3c72523 | mzp/coq-ruby | auto.mli | (************************************************************************)
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/tactics/auto.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
Hint Apply
Hint EApply
Hint... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : auto.mli 12187 20... |
f589dbe33db3dda8e83e854fa8812a80c79942786baf59e6e3e1081761e9f437 | zero-one-group/geni | unmangle.clj | ;; Taken from
(ns zero-one.geni.rdd.unmangle
(:require
[clojure.string :as string])
(:import
(clojure.lang Compiler)))
(defn- internal-call? [^StackTraceElement element]
(let [class-name (.getClassName element)]
(or (string/starts-with? class-name "zero_one.geni")
(string/starts-with? class-n... | null | https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/src/clojure/zero_one/geni/rdd/unmangle.clj | clojure | Taken from | (ns zero-one.geni.rdd.unmangle
(:require
[clojure.string :as string])
(:import
(clojure.lang Compiler)))
(defn- internal-call? [^StackTraceElement element]
(let [class-name (.getClassName element)]
(or (string/starts-with? class-name "zero_one.geni")
(string/starts-with? class-name "clojure.la... |
ba92dd4849210575102f7d97a5e1234f7c3bdf86a0e937c2b0ead0b4c04683d8 | coopernurse/cis194 | Week1Spec.hs | module Cis194.Hw.Week1Spec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Cis194.Hw.Week1
import Cis194.Hw . AcceptHanoi
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "toDigits" $ do
it "should split digits of integer into a list" $ do
toDigits 1234 `shouldBe` [1,2,3... | null | https://raw.githubusercontent.com/coopernurse/cis194/592f0ae06cf606d1c2fbe0d055a1e4b67dfc2d0f/test/Cis194/Hw/Week1Spec.hs | haskell | module Cis194.Hw.Week1Spec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Cis194.Hw.Week1
import Cis194.Hw . AcceptHanoi
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "toDigits" $ do
it "should split digits of integer into a list" $ do
toDigits 1234 `shouldBe` [1,2,3... | |
a58b229d87ec23b911fe3bf5f0c604fe867ab0734802818e5190894fe84435f8 | verse-lab/ego | ordered_set.mli | module type S = sig
type t
type elt
val create : unit -> t
val push : elt -> t -> unit
val pop : t -> elt
val pop_opt : t -> elt option
val append : t -> elt list -> unit
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val length : t -> int
val iter : (elt -> unit) -> t -> unit
... | null | https://raw.githubusercontent.com/verse-lab/ego/5daf312f8a444f9abcde5996c671b9282727a972/lib/ordered_set.mli | ocaml | module type S = sig
type t
type elt
val create : unit -> t
val push : elt -> t -> unit
val pop : t -> elt
val pop_opt : t -> elt option
val append : t -> elt list -> unit
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val length : t -> int
val iter : (elt -> unit) -> t -> unit
... | |
e7b7411c8f3ad7f7ac358914a05a237d94dc9b17b6b6352cb26931704a3de237 | mejgun/haskell-tdlib | ToggleGroupCallIsMyVideoPaused.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.ToggleGroupCallIsMyVideoPaused where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
Toggles whether current user 's video is paused @group_call_id Group call identifier @is_my_video_paused Pass true if... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/ToggleGroupCallIsMyVideoPaused.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
|
| |
module TD.Query.ToggleGroupCallIsMyVideoPaused where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
Toggles whether current user 's video is paused @group_call_id Group call identifier @is_my_video_paused Pass true if the current user 's video is paused
data Tog... |
5bd5ba4a98e24940f98899960de801a23a1c5e05892fdbafcc320588b6e2e2a5 | gadfly361/re-pollsive | config.cljs | (ns re-pollsive.config)
(def debug?
^boolean goog.DEBUG)
| null | https://raw.githubusercontent.com/gadfly361/re-pollsive/7571948f5abefb772f6f37a3fb09a801031be8c3/src/demo/re_pollsive/config.cljs | clojure | (ns re-pollsive.config)
(def debug?
^boolean goog.DEBUG)
| |
0e69d775dd21a2a2e3c95be78cb477afd42e7804cfd3071a5d478eedea1d5461 | PacktWorkshops/The-Clojure-Workshop | repl.clj | 1
(def x 10)
2
x
3
(def x 20)
x
4
(inc x)
x
5
x
(do (def x 42))
x
6
(let [y 3] (println y) (* 10 y))
7
y
8
(let [x 3] (println x))
x
9
(let [x 10 y 20] (str "x is " x " and y is " y))
10
(def message "Let's add them all!")
(let [x (* 10 3)
y 20
z 100]
(println message)
(+ x... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter01/Exercise1.04/repl.clj | clojure | 1
(def x 10)
2
x
3
(def x 20)
x
4
(inc x)
x
5
x
(do (def x 42))
x
6
(let [y 3] (println y) (* 10 y))
7
y
8
(let [x 3] (println x))
x
9
(let [x 10 y 20] (str "x is " x " and y is " y))
10
(def message "Let's add them all!")
(let [x (* 10 3)
y 20
z 100]
(println message)
(+ x... | |
36b2b24fb63a3d4cfd94192148333830a960c5b50a9c27a0b64283413dd087f6 | quoll/asami | test_entity.cljc | (ns asami.entities.test-entity
#?(:clj (:refer-clojure :exclude [read-string]))
(:require [asami.entities.writer :refer [entities->triples entity-update->triples ident-map->triples]]
[asami.entities.reader :refer [graph->entities ref->entity]]
[asami.entities.helper-stub :as test-helper]
... | null | https://raw.githubusercontent.com/quoll/asami/db42e4c1f4593ee1e22d5a644af21bb72d539417/test/asami/entities/test_entity.cljc | clojure | (ns asami.entities.test-entity
#?(:clj (:refer-clojure :exclude [read-string]))
(:require [asami.entities.writer :refer [entities->triples entity-update->triples ident-map->triples]]
[asami.entities.reader :refer [graph->entities ref->entity]]
[asami.entities.helper-stub :as test-helper]
... | |
7337c70c604689719f17b53418c107eae390b5e91576ef83dfe55ba4b1e18d2e | cjohansen/pharmacist | schema.cljc | (ns pharmacist.schema
"Tools for mapping, conforming, and verifying data."
(:require #?(:cljs [cljs.spec.alpha :as s]
:clj [clojure.spec.alpha :as s])
[clojure.string :as str]))
(s/def ::unique #{::identity})
(s/def ::spec (s/or :spec keyword? :fn ifn?))
(s/def ::source any?)
(s/def ::co... | null | https://raw.githubusercontent.com/cjohansen/pharmacist/ecbba7d72aadeb16a42f427ac87afd7b9daa4c22/src/pharmacist/schema.cljc | clojure | => {:person/name \"Wonderwoman\"} | (ns pharmacist.schema
"Tools for mapping, conforming, and verifying data."
(:require #?(:cljs [cljs.spec.alpha :as s]
:clj [clojure.spec.alpha :as s])
[clojure.string :as str]))
(s/def ::unique #{::identity})
(s/def ::spec (s/or :spec keyword? :fn ifn?))
(s/def ::source any?)
(s/def ::co... |
5b0047cd443b11ea52ad438d14e1c684ca0ec0af5cdf45c152e32a37c410d201 | sergv/constrained | Instances.hs | ----------------------------------------------------------------------------
-- |
Module : Data . . Constrained . Instances
Copyright : ( c ) 2019
License : BSD-2 ( see LICENSE )
-- Maintainer : sergey@debian
----------------------------------------------------------------------------
{-... | null | https://raw.githubusercontent.com/sergv/constrained/7a07b686e0f5fc039dd75f7358584487372ab3e2/constrained-platform-instances/src/Data/Traversable/Constrained/Instances.hs | haskell | --------------------------------------------------------------------------
|
Maintainer : sergey@debian
--------------------------------------------------------------------------
# LANGUAGE ConstraintKinds # | Module : Data . . Constrained . Instances
Copyright : ( c ) 2019
License : BSD-2 ( see LICENSE )
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -Wno - orphans #
module Data.Traversable.Constrained.Instances () where
import qualified Data.Array as A
... |
64a5164cfb5a58e1b7c9c847b136ad5686216534be963bb9c2afaf57f4090bcf | schani/clojurec | pattern_test.clj | (ns cljc.pattern-test
(:use clojure.test
cljc.test
cljc.driver))
(deftest re-seq
(testing "re-seq"
(is (= (core-run '(pr (re-seq (re-pattern "foo") "foo"))) [["foo"]]))
(is (= (core-run '(pr (re-seq (re-pattern "\\d") "123"))) [["1" "2" "3"]]))
(is (= (core-run '(pr (re-seq (re-pattern ... | null | https://raw.githubusercontent.com/schani/clojurec/e0dc2be70d357a0c9bf883db441f2db935b4014e/test/clj/cljc/pattern_test.clj | clojure | (ns cljc.pattern-test
(:use clojure.test
cljc.test
cljc.driver))
(deftest re-seq
(testing "re-seq"
(is (= (core-run '(pr (re-seq (re-pattern "foo") "foo"))) [["foo"]]))
(is (= (core-run '(pr (re-seq (re-pattern "\\d") "123"))) [["1" "2" "3"]]))
(is (= (core-run '(pr (re-seq (re-pattern ... | |
b0b0df77623c1c02150da9eac260d5a956f02465742cd5e3dd75bfdfba96a00a | locusmath/locus | object.clj | (ns locus.set.quiver.nary.core.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.sequence.object :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.con.core.setpart :refer :all]
... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/set/quiver/nary/core/object.clj | clojure | A nary quiver is a family of parallel functions in the topos Sets. It is an object of the
of topos theory like pairs of sets, functions, quivers, and ternary quivers. In the topos
theoretic foundations of algebra, nary quivers are the most basic building block. As
objects of a topos, all important constructs are ge... | (ns locus.set.quiver.nary.core.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.sequence.object :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.con.core.setpart :refer :all]
... |
7b95fa1344461ae0b7d0b13bf9baebc71c88c51dd69a48003665243d851fb32a | google/codeworld | source.hs |
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to ... | null | https://raw.githubusercontent.com/google/codeworld/77b0863075be12e3bc5f182a53fcc38b038c3e16/codeworld-compiler/test/testcases/animationWithoutTime/source.hs | haskell |
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to ... | |
66d2c1840920bf2fa00e173d051079c0c28c64cac1c0af3409a01df69c21cec9 | mirage/ocaml-rpc | htmlgen.ml | open Rpc.Types
open Idl
open Codegen
open Cow.Html
(* Printable string of type *)
let rec html_of_t : type a. a typ -> string list =
let of_basic : type b. b basic -> string = function
| Int -> "int"
| Int32 -> "int32"
| Int64 -> "int64"
| Bool -> "bool"
| Float -> "float"
| String -> "string... | null | https://raw.githubusercontent.com/mirage/ocaml-rpc/fdbf7f5c3e4f0c75837f0a96d5d4d6458805fd57/src/html/htmlgen.ml | ocaml | Printable string of type
Function inputs and outputs in a table
TODO: Unify with the above! | open Rpc.Types
open Idl
open Codegen
open Cow.Html
let rec html_of_t : type a. a typ -> string list =
let of_basic : type b. b basic -> string = function
| Int -> "int"
| Int32 -> "int32"
| Int64 -> "int64"
| Bool -> "bool"
| Float -> "float"
| String -> "string"
| Char -> "char"
in
l... |
448f68cd451717f2c9489d5c476f6feaae3d634b5fdb95c5900ec3f80da3d256 | ndaniels/MRFy | ParRandom.hs | module ParRandom
( parRandom, parRandomRepeatable
)
where
import Control.Monad.LazyRandom
import Control.Parallel.Strategies
-- | Performs a bunch of stochastic computations in parallel.
-- Basically like @sequence@ only not sequential.
parRandom :: RandomGen r => [Rand r a] -> Rand r [a]
parRand... | null | https://raw.githubusercontent.com/ndaniels/MRFy/9b522d991a9bf98a6690f791dc92ad6fe675115c/ParRandom.hs | haskell | | Performs a bunch of stochastic computations in parallel.
Basically like @sequence@ only not sequential.
sequential
| Perform stochastic computations in parallel in a deterministic,
reproducible way. | module ParRandom
( parRandom, parRandomRepeatable
)
where
import Control.Monad.LazyRandom
import Control.Parallel.Strategies
parRandom :: RandomGen r => [Rand r a] -> Rand r [a]
return $ withStrategy (parList rseq) $ zipWith evalRand ms gens
parRandomRepeatable :: [Rand StdGen ... |
31978172f7d70e7d1eb880ef335020643023396f07b022d5064326c0adae37f0 | draperlaboratory/VIBES | types.ml | (***************************************************************************)
(* *)
Copyright ( C ) 2022/2023 The Charles Stark Draper Laboratory , Inc.
(* *)
(* This... | null | https://raw.githubusercontent.com/draperlaboratory/VIBES/e140ed6d70e997feed67d350a270454198681360/tools/vibes-minizinc/lib/types.ml | ocaml | *************************************************************************
This file is provided under the license found in the LICENSE file in
the top-level director... | Copyright ( C ) 2022/2023 The Charles Stark Draper Laboratory , Inc.
This research was developed with funding from the Defense Advanced
Research Projects Agency ( DARPA ) .
open Core
open Bap.Std
open Monads.Std
open Bap_core_theory
module CT = Vibes_utils.Cor... |
273d9801ee46df72ba3f3599f6a9f4385f986547e1ff1a16e1b5ea547efb798d | andrenth/sequoia | update.mli | (** [UPDATE] query builder. *)
module type S = sig
type _ t
(** The type of [UPDATE] queries. *)
val seal : handover:Expr.handover -> 't t
-> string * Param.t list
* the end of a [ UPDATE ] query .
(** Definitions for [ORDER BY] clauses. *)
module OrderBy : sig
type order
(** The ord... | null | https://raw.githubusercontent.com/andrenth/sequoia/77d1a429042213f2ff76e5d397c876bc18f4ab64/src/update.mli | ocaml | * [UPDATE] query builder.
* The type of [UPDATE] queries.
* Definitions for [ORDER BY] clauses.
* The order type, i.e. ascending or descending.
* Expressions in [ORDER BY] clauses must specify an order.
* Type of [ORDER BY] expressions builders.
* Vector of [ORDER BY] expressions builders.
* Order by the given e... |
module type S = sig
type _ t
val seal : handover:Expr.handover -> 't t
-> string * Param.t list
* the end of a [ UPDATE ] query .
module OrderBy : sig
type order
type ('t, 'a) expr = 'a Expr.t * order
module Expr : sig
type ('t, 'a) mk = 't Table.t -> 'a Expr.t * order
mod... |
741b63a4b199452f2aba9b879dcabf776dc87df839d23ec5c32423273fa00372 | mirage/ocaml-git | neg.mli | * Negotiation engine used to fetch objects from a Git repository .
This implementation does not have any Git logics or how to store properly a
Git object . However , it implements the negotiation engine used to fetch
objects from a Git repository .
Finally , it needs fews primitives to properl... | null | https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/src/not-so-smart/neg.mli | ocaml | * Negotiation engine used to fetch objects from a Git repository .
This implementation does not have any Git logics or how to store properly a
Git object . However , it implements the negotiation engine used to fetch
objects from a Git repository .
Finally , it needs fews primitives to properl... | |
0ca81e7d01f8bc9223bda445790134e223b3c42b8953e9d321a494b930ce5be4 | dannywillems/RML | derivationTree.mli | type subtyping_node =
{ rule : string;
is_true : bool;
env : ContextType.context;
s : Grammar.nominal_typ;
t : Grammar.nominal_typ
}
type term_typing_node =
| Declaration of Grammar.nominal_decl
| Term of Grammar.nominal_term
type typing_node =
{ rule : string;
env : ContextType.context;... | null | https://raw.githubusercontent.com/dannywillems/RML/6f34748a4ea0b44037519d67200850acf6067481/src/utils/derivationTree.mli | ocaml | type subtyping_node =
{ rule : string;
is_true : bool;
env : ContextType.context;
s : Grammar.nominal_typ;
t : Grammar.nominal_typ
}
type term_typing_node =
| Declaration of Grammar.nominal_decl
| Term of Grammar.nominal_term
type typing_node =
{ rule : string;
env : ContextType.context;... | |
ce9b6c6fba5108108e56441a1ac6973c05a241d485900cb1a9a3b27202c10fd4 | sirherrbatka/cl-progress-bar | package.lisp | (in-package #:cl-user)
(defpackage :cl-progress-bar
(:use #:common-lisp)
(:export
#:update
#:with-progress-bar
#:*progress-bar*
#:*progress-bar-enabled*))
(defpackage :cl-progress-bar.progress
(:use #:common-lisp)
(:export
#:progress-bar
#:start-display
#:finish-display
#:mutex
#:... | null | https://raw.githubusercontent.com/sirherrbatka/cl-progress-bar/9374170858663c8fe829e9fb5a29bd2cb48d95ae/src/package.lisp | lisp | (in-package #:cl-user)
(defpackage :cl-progress-bar
(:use #:common-lisp)
(:export
#:update
#:with-progress-bar
#:*progress-bar*
#:*progress-bar-enabled*))
(defpackage :cl-progress-bar.progress
(:use #:common-lisp)
(:export
#:progress-bar
#:start-display
#:finish-display
#:mutex
#:... | |
115bbbad713a5f1bac98ba2e5883a7a5c8cd617dc857e4a2629e08d687d4e988 | BranchTaken/Hemlock | test_hash_fold.ml | open! Basis.Rudiments
open! Basis
open Hmc.Realer
let test () =
let rec test_hash_fold rs = begin
match rs with
| [] -> ()
| r :: rs' -> begin
File.Fmt.stdout
|> Fmt.fmt "hash_fold "
|> pp r
|> Fmt.fmt " -> "
|> Hash.pp (Hash.t_of_state (hash_fold r Hash.State.empt... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/hmc/realer/test_hash_fold.ml | ocaml | open! Basis.Rudiments
open! Basis
open Hmc.Realer
let test () =
let rec test_hash_fold rs = begin
match rs with
| [] -> ()
| r :: rs' -> begin
File.Fmt.stdout
|> Fmt.fmt "hash_fold "
|> pp r
|> Fmt.fmt " -> "
|> Hash.pp (Hash.t_of_state (hash_fold r Hash.State.empt... | |
5cee334e713dfef10fedb732b76b4ba58b3c3eac9f522492080b3bf6aff67911 | rjohnsondev/haskellshop | Admin.hs | {-# LANGUAGE OverloadedStrings #-}
module Admin.Admin where
import Admin.Categories
import Admin.Feedback
import Admin.NewProduct
import Admin.ProductVariants
import Application
import Control.Applicative
import Data.ByteString (ByteString)
import Data.Maybe
import FormUtil
import Snap.Core
import Snap.Snaplet
import... | null | https://raw.githubusercontent.com/rjohnsondev/haskellshop/645f9e40b9843fc987d37a0ee58460929ef50aae/src/Admin/Admin.hs | haskell | # LANGUAGE OverloadedStrings #
| The application's routes. |
module Admin.Admin where
import Admin.Categories
import Admin.Feedback
import Admin.NewProduct
import Admin.ProductVariants
import Application
import Control.Applicative
import Data.ByteString (ByteString)
import Data.Maybe
import FormUtil
import Snap.Core
import Snap.Snaplet
import Snap.Snaplet.Auth
import Snap.Snap... |
b3e1ca6ad5cb7ed0c81776684b48f1d0e7888327c5bd453506233910dbf3dc3a | theodormoroianu/SecondYearCourses | LambdaChurch_20210415170639.hs | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/LambdaChurch_20210415170639.hs | haskell | alpha-equivalence
subst u x t defines [u/x]t, i.e., substituting u for x in t
This substitution avoids variable captures so it is safe to be used when
reducing terms with free variables (e.g., if evaluating inside lambda abstractions)
^ substitution term
^ variable to be substitutes
^ term in which the substit... | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... |
bc81fcc4855a0df0e488bb68d503ae4e221e9d6901bef2e4f9975f7446fc4817 | funimagej/fun.imagej | statistics.clj | (ns fun.imagej.test.imp.statistics
(:use [fun.imagej imp]
[fun.imagej.imp statistics]
[clojure.test]))
(deftest test-empty-image
(let [imp1 (create-imp :width 10 :height 10)]
(is (zero? (:mean (get-image-statistics imp1))))))
| null | https://raw.githubusercontent.com/funimagej/fun.imagej/dcbe14581ba9394d8ecc6e254e02fac8130a942d/test/fun/imagej/test/imp/statistics.clj | clojure | (ns fun.imagej.test.imp.statistics
(:use [fun.imagej imp]
[fun.imagej.imp statistics]
[clojure.test]))
(deftest test-empty-image
(let [imp1 (create-imp :width 10 :height 10)]
(is (zero? (:mean (get-image-statistics imp1))))))
| |
48fc959f8e3ffe75abc9fb06e8448d4085213686852e52d647b0268e5c96a08e | lgessler/fulcro-material-ui-template | project_detail.cljs | (ns fmuit.client.ui.project.project-detail
(:require [com.fulcrologic.fulcro.components :as c :refer [defsc]]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[com.fulcrologic.fulcro.data-fetch :as df]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic... | null | https://raw.githubusercontent.com/lgessler/fulcro-material-ui-template/efc36f25675de10800f63274616a8ff42d08f088/src/main/fmuit/client/ui/project/project_detail.cljs | clojure | (ns fmuit.client.ui.project.project-detail
(:require [com.fulcrologic.fulcro.components :as c :refer [defsc]]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[com.fulcrologic.fulcro.data-fetch :as df]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic... | |
93de664bb9d2a38fa9753159b2b1814e621609ce8a75c534634b33dbb79e13d4 | patrikja/AFPcourse | Array2.hs | # LANGUAGE TypeFamilies , FlexibleInstances , FlexibleContexts ,
GeneralizedNewtypeDeriving #
GeneralizedNewtypeDeriving #-}
module Array where
{- An associated type is like a type member in a class, much like the
class methods are function members of the class.
A type family is like a function on the... | null | https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/L13/src/Array2.hs | haskell | An associated type is like a type member in a class, much like the
class methods are function members of the class.
A type family is like a function on the type level where you can pattern
match on the type arguments. An important difference is that it's /open/
which means that you can add more equations ... | # LANGUAGE TypeFamilies , FlexibleInstances , FlexibleContexts ,
GeneralizedNewtypeDeriving #
GeneralizedNewtypeDeriving #-}
module Array where
newtype Index = Index {unIndex :: Int} deriving (Show, Enum, Num, Eq)
newtype Size = Size {unSize :: Int} deriving (Show, Num, Eq)
toIndex :: Size -> Index
toInd... |
595c76bd75e6e56f20b9a02128804cfabe33213464ac9482f872e4546e34daf1 | lisp-mirror/clpm | client.lisp | ;;;; Building the client
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(in-package #:clpm-asdf)
(defclass release-clpm-client-directory (ops::release-module)
())
(defmethod ops::release-component-class-by-type (parent (type (eql :clpm-client-... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/clpm-asdf/client.lisp | lisp | Building the client
LICENSE for license information. | This software is part of CLPM . See README.org for more information . See
(in-package #:clpm-asdf)
(defclass release-clpm-client-directory (ops::release-module)
())
(defmethod ops::release-component-class-by-type (parent (type (eql :clpm-client-directory)))
'release-clpm-client-directory)
(defmethod asdf:inpu... |
dade116fac5ffcbe3d5496ccf7e1103692dbcdfb563e4c8dd75d3872446053f2 | fare/xcvb | func-1.lisp | #+xcvb (module (:depends-on ("package")))
(in-package :lib-a)
(defun lib-a/func-1 ()
(format t "This function 1 from lib-a!~%"))
| null | https://raw.githubusercontent.com/fare/xcvb/460e27bd4cbd4db5e7ddf5b22c2ee455df445258/examples/example-2/lib-a/func-1.lisp | lisp | #+xcvb (module (:depends-on ("package")))
(in-package :lib-a)
(defun lib-a/func-1 ()
(format t "This function 1 from lib-a!~%"))
| |
05c4438a0f619973823f5597fe9e3d3925359c9b90c6c9910a0896b6b8e1e6e3 | pflanze/chj-schemelib | hashcollection.scm | Copyright 2018 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require dot-oo
j... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/hashcollection.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
for tests only
XX currently without a key accessor; add this, or is hash: argument
actually all we need? | Copyright 2018 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require dot-oo
jclass
test
cj-functional-2
slib-sort)
(export (jclass hashcollection)
(method list.hashcollection))
(jcla... |
8c7f8f0a7920069d17703c197c72df4ae3714d924f139435b8e37b4b3c23172a | disteph/cdsat | register.ml | open Format
module Bool = Theory.Make(Bool.MyTheory)
module Arrays = Theory.Make(Arrays.MyTheory)
module LRA = Theory.Make(LRA.MyTheory)
module IfThenElse = Theory.Make(IfThenElse.MyTheory)
module Tags = struct
type _ t =
| Bool : (_,_,_,_) Bool.signature t
| Arrays: (_,_,_,_) Arrays.signatur... | null | https://raw.githubusercontent.com/disteph/cdsat/1b569f3eae59802148f4274186746a9ed3e667ed/src/kernel/kernel.mld/theories.mld/register.ml | ocaml | open Format
module Bool = Theory.Make(Bool.MyTheory)
module Arrays = Theory.Make(Arrays.MyTheory)
module LRA = Theory.Make(LRA.MyTheory)
module IfThenElse = Theory.Make(IfThenElse.MyTheory)
module Tags = struct
type _ t =
| Bool : (_,_,_,_) Bool.signature t
| Arrays: (_,_,_,_) Arrays.signatur... | |
ee274ac1282f674ab7b81e24557517d4da514d60020f508b11d39a7bb0819e2e | onedata/op-worker | atm_workflow_execution_status.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module contains functions tha... | null | https://raw.githubusercontent.com/onedata/op-worker/171b05ac629acb4fc337b7dc2f5bf7c433d2c23f/src/modules/automation/workflow/atm_workflow_execution_status.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
This module contains functions that handle atm workflow execution status
transitions according to following state machine:
|
... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
I | RESUMING | first lane run transitioned |
N + ------------+ to preparing status |
= = = = = |====|===|===============... |
b90fabee7b36ac47d0e15ea020328800f169065b3a7643fab8d8285ef17293f7 | rjohnsondev/haskellshop | Variant.hs | {-# LANGUAGE OverloadedStrings #-}
module ShopData.Variant where
import Snap.Snaplet.PostgresqlSimple
import qualified Data.Text as DT
import qualified ShopData.VariantOption as VO
data Variant = Variant
{ variantId :: Int,
name :: DT.Text,
adjustsPrice :: Bool,
isSearchable :: Bool,
... | null | https://raw.githubusercontent.com/rjohnsondev/haskellshop/645f9e40b9843fc987d37a0ee58460929ef50aae/src/ShopData/Variant.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: make this betterer |
module ShopData.Variant where
import Snap.Snaplet.PostgresqlSimple
import qualified Data.Text as DT
import qualified ShopData.VariantOption as VO
data Variant = Variant
{ variantId :: Int,
name :: DT.Text,
adjustsPrice :: Bool,
isSearchable :: Bool,
options :: [VO.VariantOption]... |
af07a859b4947e6ff49f6cf5b04b4f940f8624684d225585d1a88b6a080539a8 | input-output-hk/ekg-forward | Configuration.hs | module System.Metrics.Configuration
( AcceptorConfiguration (..)
, ForwarderConfiguration (..)
, HowToConnect (..)
, Host
, Port
) where
import Control.Concurrent.STM.TVar (TVar)
import Control.Tracer (Tracer)
import Data.Text (Text)
import Data.Time.Clock (NominalDi... | null | https://raw.githubusercontent.com/input-output-hk/ekg-forward/d9e8fd302fa6ba41c07183d371e6777286d37bc2/src/System/Metrics/Configuration.hs | haskell | | Specifies how to connect to the peer.
^ Remote socket (host and port).
| Acceptor configuration.
| The tracer that will be used by the acceptor in its network layer.
| The endpoint that will be used to listen to the forwarder.
| Specifies how often the acceptor will ask the framework for new metrics.
| Specifi... | module System.Metrics.Configuration
( AcceptorConfiguration (..)
, ForwarderConfiguration (..)
, HowToConnect (..)
, Host
, Port
) where
import Control.Concurrent.STM.TVar (TVar)
import Control.Tracer (Tracer)
import Data.Text (Text)
import Data.Time.Clock (NominalDi... |
9ec8c05c73b61f0bd8a2853a329d360cbf57e5ba8be662a2498d91ef107c4e5a | ailrk/lambda-cube | Syntax.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
module Syntax where
import AST
import Control.Monad
import Control.Monad.State
import Control.Monad.Trans.Class
import Data.Maybe
import ... | null | https://raw.githubusercontent.com/ailrk/lambda-cube/eea2ac0fe51ec69f3be18895f4c50974dc565797/UTLC/src/Syntax.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
module Syntax where
import AST
import Control.Monad
import Control.Monad.State
import Control.Monad.Trans.Class
import Data.Maybe
import Data.Sequence ... |
fa0f390ce2af2bcd7a86c437d4f09a92b1202e8f585b645d0559c1567d48795b | CRogers/obc | output.ml |
* output.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions ... | null | https://raw.githubusercontent.com/CRogers/obc/49064db244e0c9d2ec2a83420c8d0ee917b54196/yacc/output.ml | ocaml | Text output with counted lines
Formatting utilities
fill_print -- filled output lines
A table with entries given by a function
Parts of the output file
Definition of the 'token' type
Translation tables from OCaml constructors to token numbers
Action code
The dummy rule 0 -- never reduced
The dummy ru... |
* output.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions ... |
8d0a1d2f9e8f46dee4c243a4153ab9a93eba64d8279dbaed01d97463c721fc2d | PrecursorApp/precursor | access_grant.clj | (ns pc.models.access-grant
(:require [pc.datomic :as pcd]
[pc.datomic.web-peer :as web-peer]
[clj-time.core :as time]
[clj-time.coerce]
[crypto.random]
[pc.datomic.web-peer :as web-peer]
[datomic.api :refer [db q] :as d]))
(defn read-api [grant]... | null | https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src/pc/models/access_grant.clj | clojure | (ns pc.models.access-grant
(:require [pc.datomic :as pcd]
[pc.datomic.web-peer :as web-peer]
[clj-time.core :as time]
[clj-time.coerce]
[crypto.random]
[pc.datomic.web-peer :as web-peer]
[datomic.api :refer [db q] :as d]))
(defn read-api [grant]... | |
180b3bb1b974f328b87c264db2fbfc505fe4bb76e4d85d391e606f6f4e2525eb | fpottier/mpri-2.4-projet-2022-2023 | Main.mli | (* This file is intentionally empty. *)
| null | https://raw.githubusercontent.com/fpottier/mpri-2.4-projet-2022-2023/1ce08cadfb3a8ec8bc72609bc82873b29d2ce241/src/Main.mli | ocaml | This file is intentionally empty. | |
9c01c80b2cf05c4a2237926fb80593059bf5799be98b98a2716fe0448a3b3a4d | fukamachi/clozure-cl | views.lisp | ;;; -*- Mode: Lisp; Package: hemlock-internals -*-
(in-package :hemlock-internals)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; A HEMLOCK-VIEW represents text displayed in a (pane inside a) window.
;; Conceptually it consists of a text buffer, a modeline for semi-per... | null | https://raw.githubusercontent.com/fukamachi/clozure-cl/4b0c69452386ae57b08984ed815d9b50b4bcc8a2/cocoa-ide/hemlock/src/views.lisp | lisp | -*- Mode: Lisp; Package: hemlock-internals -*-
A HEMLOCK-VIEW represents text displayed in a (pane inside a) window.
Conceptually it consists of a text buffer, a modeline for semi-permanent status
info, an echo area for transient status info, and a text input area for reading
A HEMLOCK-VIEW never changes which ... |
(in-package :hemlock-internals)
prompted input . Currently the last two are conflated .
The user interacts with a HEMLOCK - VIEW using events . Each time the user presses a
(defvar *current-view* nil)
(defun current-view (&optional (must-exist t))
(or *current-view*
(and must-exist (error "Hemlock vi... |
0b1391d4df71f15823c622453d3f0edee56b056389dda0e988e6da2ea496ff2e | zkincaid/duet | test_smt.ml | open Srk
open OUnit
open Syntax
open Test_pervasives
let b = Ctx.mk_const (Ctx.mk_symbol ~name:"b" `TyBool)
let gsym = Ctx.mk_symbol ~name:"g" (`TyFun ([`TyInt; `TyInt], `TyInt))
let g : Ctx.arith_term * Ctx.arith_term -> Ctx.arith_term =
fun (x, y) -> Ctx.mk_app gsym [x; y]
let fsym = Ctx.mk_symbol ~name:"f" (`Ty... | null | https://raw.githubusercontent.com/zkincaid/duet/d204e01acc3662477abe664e8c24ce4e8abc73e9/srk/test/test_smt.ml | ocaml | open Srk
open OUnit
open Syntax
open Test_pervasives
let b = Ctx.mk_const (Ctx.mk_symbol ~name:"b" `TyBool)
let gsym = Ctx.mk_symbol ~name:"g" (`TyFun ([`TyInt; `TyInt], `TyInt))
let g : Ctx.arith_term * Ctx.arith_term -> Ctx.arith_term =
fun (x, y) -> Ctx.mk_app gsym [x; y]
let fsym = Ctx.mk_symbol ~name:"f" (`Ty... | |
f977dcc90c46f0765b341eb36268b9531f89088a084d0c956f6205062e7a4353 | keigoi/session-ocaml | example_journal1.ml | open Session
let xor : bool -> bool -> bool = (<>)
let print_bool = Printf.printf "%B"
let xor_ch = new_channel ();;
Thread.create
(accept_ xor_ch (fun () ->
recv s >>= fun (x,y) ->
send s (xor x y) >>
close s)) ();;
connect_ xor_ch (fun () ->
send s (false,true) >>
recv s >>= fun b ->
print_bool b;... | null | https://raw.githubusercontent.com/keigoi/session-ocaml/f365456043b349874a5ce5444d313f365d5573c6/examples/example_journal1.ml | ocaml | open Session
let xor : bool -> bool -> bool = (<>)
let print_bool = Printf.printf "%B"
let xor_ch = new_channel ();;
Thread.create
(accept_ xor_ch (fun () ->
recv s >>= fun (x,y) ->
send s (xor x y) >>
close s)) ();;
connect_ xor_ch (fun () ->
send s (false,true) >>
recv s >>= fun b ->
print_bool b;... | |
a0236f8ebdec6e964f3a98880b6f61a4fac08a40a466e8c628b546085f33d543 | anoma/juvix | FunctionCall.hs | module Juvix.Compiler.Internal.Translation.FromAbstract.Analysis.Termination.FunctionCall
( module Juvix.Compiler.Internal.Translation.FromAbstract.Analysis.Termination.FunctionCall,
)
where
import Data.HashMap.Strict qualified as HashMap
import Juvix.Compiler.Abstract.Extra
import Juvix.Compiler.Internal.Translat... | null | https://raw.githubusercontent.com/anoma/juvix/807b3b1770289b8921304e92e7305c55c2e11f8f/src/Juvix/Compiler/Internal/Translation/FromAbstract/Analysis/Termination/FunctionCall.hs | haskell | implicit arguments are ignored | module Juvix.Compiler.Internal.Translation.FromAbstract.Analysis.Termination.FunctionCall
( module Juvix.Compiler.Internal.Translation.FromAbstract.Analysis.Termination.FunctionCall,
)
where
import Data.HashMap.Strict qualified as HashMap
import Juvix.Compiler.Abstract.Extra
import Juvix.Compiler.Internal.Translat... |
9d1bbe50831bbde9e9deb5bf2ac9fc132b9b3ba248d9a3c4e8c742dfaf35075d | S8A/htdp-exercises | ex272.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex272) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp"))) (htdp-settin... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex272.rkt | racket | about the language level of this file in a form that our tools can easily process.
[X] [List-of X] [List-of X] -> [List-of X]
Appends list2 to list1 using foldr
Q: What happens if you replace foldr with foldl?
[List-of Number] -> Number
Computes the sum of the numbers in the list
[List-of Number] -> Number
Comp... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex272) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "image.rkt" "teachpack" "2ht... |
9dc245398fc6fd6f72572e7f997a9d86755d91d48eadb561806357c241edefe7 | mentat-collective/Clerk-Utils | user.clj | (ns user
(:require [mentat.clerk-utils.build :as b]))
(def index
"dev/clerk_utils/notebook.clj")
(def defaults
{:index index
:browse? true
:watch-paths ["dev"]
:cljs-namespaces '[clerk-utils.sci-extensions
clerk-utils.show]})
(def static-defaults
(assoc defaults
:brows... | null | https://raw.githubusercontent.com/mentat-collective/Clerk-Utils/d5e3b9e33d210f72dd9d6b87827696821b841b4a/dev/user.clj | clojure | (ns user
(:require [mentat.clerk-utils.build :as b]))
(def index
"dev/clerk_utils/notebook.clj")
(def defaults
{:index index
:browse? true
:watch-paths ["dev"]
:cljs-namespaces '[clerk-utils.sci-extensions
clerk-utils.show]})
(def static-defaults
(assoc defaults
:brows... | |
e5d579b7a37c9e3e27b63550999555f2d2f9f235f109b64693a26ad8b18465a0 | mejgun/haskell-tdlib | SaveApplicationLogEvent.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.SaveApplicationLogEvent where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.JsonValue as JsonValue
import qualified Utils as U
-- |
-- Saves application log event on the server. Can be called before authorizati... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/SaveApplicationLogEvent.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data
|
|
| |
module TD.Query.SaveApplicationLogEvent where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.JsonValue as JsonValue
import qualified Utils as U
data SaveApplicationLogEvent = SaveApplicationLogEvent
_data :: Maybe JsonValue.JsonValue,
chat_id :: Maybe Int,
... |
502f437a5efa746483f8191411ed30d31d7883384b8eb585dc30d645c67a1b48 | luminus-framework/luminus-template | boot.clj | (ns leiningen.new.boot
(:require [leiningen.new.common :refer :all]))
(def boot-dependencies '[[adzerk/boot-test "1.2.0" :scope "test"]])
(defn boot-features [[assets options :as state]]
(if (some #{"+boot"} (:features options))
[(conj assets ["build.boot" "core/build.boot"])
(let [new-opts (-> options
... | null | https://raw.githubusercontent.com/luminus-framework/luminus-template/3278aa727cef0a173ed3ca722dfd6afa6b4bbc8f/src/leiningen/new/boot.clj | clojure | There is a conflict with dependencies with ring webjars when
org.webjars/webjars-locator-jboss-vfs is added, but only under
boot. This removes the conflict | (ns leiningen.new.boot
(:require [leiningen.new.common :refer :all]))
(def boot-dependencies '[[adzerk/boot-test "1.2.0" :scope "test"]])
(defn boot-features [[assets options :as state]]
(if (some #{"+boot"} (:features options))
[(conj assets ["build.boot" "core/build.boot"])
(let [new-opts (-> options
... |
dd7b4db1dc35299fb1e4d08b14b5e4062d52df4fa1e3a8f10b1c44a8f0622941 | Octachron/tensority | small_unified.mli |
type _ t =
| Scalar: float ref -> < contr:Shape.empty; cov: Shape.empty > t
| Vec: 'a Small_vec.t -> < contr: 'a Shape.single; cov: Shape.empty > t
| Matrix: ('a * 'b) Small_matrix.t -> < contr:'a Shape.single; cov:'b Shape.single > t
val scalar: float -> <contr:Shape.empty; cov:Shape.empty > t
val vector :
'... | null | https://raw.githubusercontent.com/Octachron/tensority/2689fba0bb9c693ef51bebe9cf92c37ab30ca17e/lib/small_unified.mli | ocaml |
type _ t =
| Scalar: float ref -> < contr:Shape.empty; cov: Shape.empty > t
| Vec: 'a Small_vec.t -> < contr: 'a Shape.single; cov: Shape.empty > t
| Matrix: ('a * 'b) Small_matrix.t -> < contr:'a Shape.single; cov:'b Shape.single > t
val scalar: float -> <contr:Shape.empty; cov:Shape.empty > t
val vector :
'... | |
16deae7aa9f700ea4599f2c6e772f6c995f204a778be2320925e3cafe40bf59b | philnguyen/soft-contract | define-contract.rkt | #lang racket
(define/contract f
((number? . -> . real?) . -> . (string . -> . string?))
(λ (on-num)
(λ (s)
(cond [(string->number s) => (λ (n) (number->string (on-num n)))]
[else ""]))))
(define/contract str-inc string? ((f values) "42"))
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/unsafe/issues/define-contract.rkt | racket | #lang racket
(define/contract f
((number? . -> . real?) . -> . (string . -> . string?))
(λ (on-num)
(λ (s)
(cond [(string->number s) => (λ (n) (number->string (on-num n)))]
[else ""]))))
(define/contract str-inc string? ((f values) "42"))
| |
71bcab8bf65f2582ac2c7fb57ddca53e7a5584f1a1fc53165839756a47b99fb8 | 8c6794b6/guile-tjit | gen-code-t.scm | -*- mode : scheme ; coding : utf-8 ; -*-
Copyright ( C ) 2014 , 2015 Free Software Foundation , Inc.
;;;;
;;;; This library 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
... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/system/vm/native/gen-code-t.scm | scheme | coding : utf-8 ; -*-
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
either version 3 of
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILIT... |
Copyright ( C ) 2014 , 2015 Free Software Foundation , Inc.
the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA
02110 - 1301 USA
(use-modules (ice-9 peg)
(i... |
955715be648a436f029bc2c7e19f08d1a3adef268338ca2455a87c5439e60e56 | kowainik/summoner | Show.hs | module Test.Show
( showCommandSpec
) where
import Test.Hspec (Spec, describe, it, shouldBe)
import Summoner.GhcVer (ghcTable)
showCommandSpec :: Spec
showCommandSpec = describe "show command golden tests" $
it "correctly shows 'show ghc'" $
ghcTable `shouldBe` goldenGhcTable
goldenGhcTab... | null | https://raw.githubusercontent.com/kowainik/summoner/0c03dd0d6ee71c79227974b697f171396d3d09a7/summoner-cli/test/Test/Show.hs | haskell | module Test.Show
( showCommandSpec
) where
import Test.Hspec (Spec, describe, it, shouldBe)
import Summoner.GhcVer (ghcTable)
showCommandSpec :: Spec
showCommandSpec = describe "show command golden tests" $
it "correctly shows 'show ghc'" $
ghcTable `shouldBe` goldenGhcTable
goldenGhcTab... | |
161d2e10f82be5cc9a8ccd3c53881767543a3e24b7cd813c643dc7652d01ecf9 | lispnik/iup | web.lisp | (defpackage #:iup-web
(:use #:common-lisp)
(:export #:open)
(:import-from #:tecgraf-base #:defalias)
(:shadow #:open))
(in-package #:iup-web)
(defalias open #'iup-web-cffi::%iup-web-browser-open)
(iup::defiupclasses "IUP-WEB")
| null | https://raw.githubusercontent.com/lispnik/iup/f8e5f090bae47bf8f91ac6fed41ec3bc01061186/web/web.lisp | lisp | (defpackage #:iup-web
(:use #:common-lisp)
(:export #:open)
(:import-from #:tecgraf-base #:defalias)
(:shadow #:open))
(in-package #:iup-web)
(defalias open #'iup-web-cffi::%iup-web-browser-open)
(iup::defiupclasses "IUP-WEB")
| |
5054aacb7b4701770b0689cd5332f4f9e2f39f6008686863194235ba393d8a4d | deobald/jok | layout.clj | (ns jukebox-web.views.layout
(:require [jukebox-web.models.user :as user]
[jukebox-web.views.track-search :as track-search])
(:use [hiccup core page form]
[jukebox-web.views.forms]))
(defn- login-form []
[:div.pull-right
[:ul
[:li.dropdown.persist {:data-dropdown "dropdown"}
[:a.d... | null | https://raw.githubusercontent.com/deobald/jok/e1b9373603ad7fcc3dbc7304cb8b88b8163e73bc/src/jukebox_web/views/layout.clj | clojure | (ns jukebox-web.views.layout
(:require [jukebox-web.models.user :as user]
[jukebox-web.views.track-search :as track-search])
(:use [hiccup core page form]
[jukebox-web.views.forms]))
(defn- login-form []
[:div.pull-right
[:ul
[:li.dropdown.persist {:data-dropdown "dropdown"}
[:a.d... | |
d1946a7f3745c54e1f3cbc3e86324e1698d6404e5b0df9339b51b09a6da75f2f | pmundkur/flowcaml | avl_tarjan.mli | (**************************************************************************)
(* *)
(* Averell *)
(* *)
... | null | https://raw.githubusercontent.com/pmundkur/flowcaml/ddfa8a37e1cb60f42650bed8030036ac313e048a/src-averell/avl_tarjan.mli | ocaml | ************************************************************************
Averell
... | , Projet Cristal , INRIA Rocquencourt
Copyright 2002 , 2003 Institut National de Recherche en Informatique
under the terms of the GNU Library General Public License , with the
$ I d : avl_tarjan.mli , v 1.3 2003/06/26 13:32:45 simonet Exp $
* Tarjan 's algorithm : calculating SCC... |
d648bea8bc4e3a70ebf6a3755df3c8ecdc8d8cfa6fcffa4ad08ba592f89ca98e | Frama-C/Frama-C-snapshot | red_statuses.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/utils/red_statuses.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
5cbaf423fff9c49871b9b8421c619b95c4efad5a5c7b8bae1574cbd8b1865392 | nklein/clifford | involutions.lisp | (in-package #:clifford)
(defgeneric grade-inversion (x))
(defgeneric reversion (x))
(defun %grade-inversion (info)
`(defmethod grade-inversion ((x ,(name info)))
(,(constructor info)
,@(iter (for v in (full-basis info))
(for k in (keywords info))
(for a in (accessors info))... | null | https://raw.githubusercontent.com/nklein/clifford/2ba9b9a8f68eb88c2821341dfac2f2a61c2f84ce/src/involutions.lisp | lisp | (in-package #:clifford)
(defgeneric grade-inversion (x))
(defgeneric reversion (x))
(defun %grade-inversion (info)
`(defmethod grade-inversion ((x ,(name info)))
(,(constructor info)
,@(iter (for v in (full-basis info))
(for k in (keywords info))
(for a in (accessors info))... | |
8ecc40cb851387d3dc022fb36e97af7bd51658b9e4f251a57d20506e3f71a286 | janestreet/base | test_int_hash.ml | open! Base
open! Import
let%expect_test ("int hash is not ident" [@tags "64-bits-only"]) =
print_s [%message "hash of 10" (Int.hash 10 : int)];
[%expect {| ("hash of 10" ("Int.hash 10" 1_579_120_067_278_557_813)) |}]
;;
| null | https://raw.githubusercontent.com/janestreet/base/8ea6adb415ebc27fec97e1ae34b9a3d5483eb3f0/test/test_int_hash.ml | ocaml | open! Base
open! Import
let%expect_test ("int hash is not ident" [@tags "64-bits-only"]) =
print_s [%message "hash of 10" (Int.hash 10 : int)];
[%expect {| ("hash of 10" ("Int.hash 10" 1_579_120_067_278_557_813)) |}]
;;
| |
b58a1bff6a40038b9ad9c4527693ac2f245d663e5787bdabfda424a082bc4b01 | afiniate/seresye | seresye_transform.erl | -module(seresye_transform).
-export([parse_transform/2]).
-record(state,{
rules = [],
rule_functions = [],
exports = [],
options
}).
-record(context, {module,
function,
arity,
file,
options}).
p... | null | https://raw.githubusercontent.com/afiniate/seresye/a5f484f5f85ad0a24acd7c5969e5a3b8daee2a80/src/seresye_transform.erl | erlang | -module(seresye_transform).
-export([parse_transform/2]).
-record(state,{
rules = [],
rule_functions = [],
exports = [],
options
}).
-record(context, {module,
function,
arity,
file,
options}).
p... | |
bdc9acf1663775cb4354050233847e643e028e94d1f63e576d62be5a17d2e828 | haskell-foundation/foundation | Common.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoImplicitPrelude #
module BenchUtil.Common
( defaultMain
, Benchmark
, Benchmarkable
, bgroup
, bench
, fbench
, whnf
, whnfIO
, nf
) where
import Gauge.Main hiding (bgroup, bench)
import qualified Gauge.Main as C
import ... | null | https://raw.githubusercontent.com/haskell-foundation/foundation/58568e9f5368170d272000ecf16ef64fb91d0732/foundation/benchs/BenchUtil/Common.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
module BenchUtil.Common
( defaultMain
, Benchmark
, Benchmarkable
, bgroup
, bench
, fbench
, whnf
, whnfIO
, nf
) where
import Gauge.Main hiding (bgroup, bench)
import qualified Gauge.Main as C
import Foundation
fbench = bench... |
efc37bff21c6ac0f31f7ec968463d1f3c59b2ca1fcc329581468a36dce5886ea | themetaschemer/malt | 0-duals.rkt | #lang racket
;;----------------------------
;; Real part of a dual is always a tensor (of any rank)
;;----------------------------
(define dual?
(λ (x)
(and (vector? x) (eq? (vector-ref x 0) dual))))
(define dual
(λ (r k)
(vector dual r k)))
(define dual*
(λ (d)
(dual (ρ d) end-of-chain)))
(defin... | null | https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/learner/tensors/0-duals.rkt | racket | ----------------------------
Real part of a dual is always a tensor (of any rank)
----------------------------
----------------------------
Chain rule
---------------------------- | #lang racket
(define dual?
(λ (x)
(and (vector? x) (eq? (vector-ref x 0) dual))))
(define dual
(λ (r k)
(vector dual r k)))
(define dual*
(λ (d)
(dual (ρ d) end-of-chain)))
(define ρ
(λ (d)
(cond
((dual? d) (vector-ref d 1))
(else d))))
(define κ
(λ (d)
(cond
((dual... |
aaf7213e639809532bc649da738388329816803d45f86da054571ba22991085b | ddmcdonald/sparser | printers.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1992 - 2005,2011 - 2021 -- all rights reserved
;;;
;;; File: "printers"
;;; Module: "objects;model:individuals:"
version : September 2021
initiated 7/16/92 v2.3 , 9/3 added Princ - individual
( 5/26/93 ) added Print - in... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/9caba4d2b0c6ea5fd55dd60fcca9c44a9af0dc9e/Sparser/code/s/objects/model/individuals/printers.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "printers"
Module: "objects;model:individuals:"
( 6/7 ) added setter function
(3/9/94) added generic pretty printer.
case to Print-individual-with-name.
(10/3) added String-for
they weren't compiling.
routine.
(1/11/11) Fi... | copyright ( c ) 1992 - 2005,2011 - 2021 -- all rights reserved
version : September 2021
initiated 7/16/92 v2.3 , 9/3 added Princ - individual
( 5/26/93 ) added Print - individual - with - name
( 4/5 ) added polyword case in str printer and an escape to a generic
name printer . ( 4/6 ) Tweeking e... |
6bd1562a904972b202c4f9c57efbd2ccb4ebc2354598ae3bb4257903deb65b55 | lspitzner/butcher | BuiltinCommands.hs | | Some CmdParser actions that add predefined commands .
module UI.Butcher.Monadic.BuiltinCommands
( addHelpCommand
, addHelpCommand2
, addHelpCommandWith
, addHelpCommandShallow
, addButcherDebugCommand
, addShellCompletionCommand
, addShellCompletionCommand'
)
where
#include "prelude.inc"
import ... | null | https://raw.githubusercontent.com/lspitzner/butcher/ad17fe776359a25e4d1bebc7890d1bf3da0880f0/src/UI/Butcher/Monadic/BuiltinCommands.hs | haskell | | Adds a proper full help command. To obtain the 'CommandDesc' value, see
'UI.Butcher.Monadic.cmdRunParserWithHelpDesc' or
> addHelpCommand = addHelpCommandWith
| Adds a proper full help command. In contrast to 'addHelpCommand',
this version is a bit more verbose about available subcommands as it
includes their ... | | Some CmdParser actions that add predefined commands .
module UI.Butcher.Monadic.BuiltinCommands
( addHelpCommand
, addHelpCommand2
, addHelpCommandWith
, addHelpCommandShallow
, addButcherDebugCommand
, addShellCompletionCommand
, addShellCompletionCommand'
)
where
#include "prelude.inc"
import ... |
efb5102525ff1f3b31dd42a92e7e513d2df4035d0fb4f203aa419b5f3a929eac | locusmath/locus | object.clj | (ns locus.set.logic.lens.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.con.core.object :refer :all]
[locus.con.core.setpart :refer :all]
[locus.set... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/set/logic/lens/object.clj | clojure | A lens is a set with a getter and a setter
We need some way to turn local effects into global ones
Methods that make effective use of the lens functionality by allowing for
the theory of local actions to take form
We need to create lens structures for product types
Get a lens to refer to a key within a map
todo | (ns locus.set.logic.lens.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.con.core.object :refer :all]
[locus.con.core.setpart :refer :all]
[locus.set... |
371c7a4e20fe046b684b000b7fd14a100d6faaaa786113ae7f2d051bb0151340 | albertoruiz/easyVision | connect.hs | import Vision.GUI.Simple
import Image
import Util.Geometry
main = runIt $ do
p <- click "click points"
w <- browser "work with them" [] (const Draw)
connectWith g p w
g _ pts = (0, [ map (Segment (Point 0 0)) pts] )
click name = standalone (Size 400 400) name [] updts [] sh
where
updts = [ (key (Mo... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/tour/connect.hs | haskell | import Vision.GUI.Simple
import Image
import Util.Geometry
main = runIt $ do
p <- click "click points"
w <- browser "work with them" [] (const Draw)
connectWith g p w
g _ pts = (0, [ map (Segment (Point 0 0)) pts] )
click name = standalone (Size 400 400) name [] updts [] sh
where
updts = [ (key (Mo... | |
2b7cbaea75b40a457a5aace0ead7665d2026ed07c14756effaf6be52ee790008 | Lysxia/first-class-families | Function.hs | {-# LANGUAGE
DataKinds,
PolyKinds,
TypeFamilies,
TypeInType,
TypeOperators,
UndecidableInstances #-}
-- | Simple combinators for functions.
module Fcf.Data.Function
( type (&)
, On
, Bicomap
) where
import Fcf.Core
infixl 1 &
-- $setup
-- >>> :set -XTypeFamilies -XDataKinds -XTypeOpe... | null | https://raw.githubusercontent.com/Lysxia/first-class-families/ba5447939927054dda71828eb5ff2a1b9abd1856/src/Fcf/Data/Function.hs | haskell | # LANGUAGE
DataKinds,
PolyKinds,
TypeFamilies,
TypeInType,
TypeOperators,
UndecidableInstances #
| Simple combinators for functions.
$setup
>>> :set -XTypeFamilies -XDataKinds -XTypeOperators
>>> import Fcf.Core
>>> import Fcf.Combinators (Pure)
>>> import Fcf.Data.Bool (type (&&), type (|... |
module Fcf.Data.Function
( type (&)
, On
, Bicomap
) where
import Fcf.Core
infixl 1 &
> > > import Fcf . Data . Common ( )
| Reverse function application , argument first .
Eval ( ' ( ' True , ' Nothing ) & Fst ) : :
data (&) :: a -> (a -> Exp b) -> Exp b
type instance Eval (x & f) = Eval (f x)
... |
bdb9733c208f2b3dffd1740840b7b44614fc66d9797814fcd664a90391231f64 | Calsign/p5ml | color.ml |
type color = {
red : int;
green : int;
blue : int;
alpha : int;
}
let constrain_color c =
min 255 (max c 0)
let rgba r g b a = {
red = constrain_color r;
green = constrain_color g;
blue = constrain_color b;
alpha = constrain_color a;
}
let rgb r g b = rgba r g b 255
let graya v a = rgba v v v a
... | null | https://raw.githubusercontent.com/Calsign/p5ml/65a379a941a7c1c99e6d43fa4a171cd4d68d4e88/core/color.ml | ocaml | remove leading pound sign
add alpha characters if not present
convert a hex digit [0-9A-Za-z] to an integer |
type color = {
red : int;
green : int;
blue : int;
alpha : int;
}
let constrain_color c =
min 255 (max c 0)
let rgba r g b a = {
red = constrain_color r;
green = constrain_color g;
blue = constrain_color b;
alpha = constrain_color a;
}
let rgb r g b = rgba r g b 255
let graya v a = rgba v v v a
... |
cea32142d6fd99240c158789c9000388cb0840018f9d8cfa2ffc1006da6d36f0 | boxer-project/boxer-sunrise | av-stubs.lisp | ;;;; -*- Mode:LISP; Syntax: Common-Lisp; Package:Boxer; -*-
;;;;
Copyright 1995 - 1996 Regents of the University of California
;;;;
Enhancements and Modifications Copyright 1998 - 2003 Pyxisystems LLC
;;;;
;;;; +-Data--+
;;;; This file is part of the... | null | https://raw.githubusercontent.com/boxer-project/boxer-sunrise/31fc8aa23c4bdc7b9100c7e9433ea0ffd14b5742/src/av/av-stubs.lisp | lisp | -*- Mode:LISP; Syntax: Common-Lisp; Package:Boxer; -*-
+-Data--+
This file is part of the | BOXER | system
+-------+
Modification History (most recent at top)
testing stubs
Each "frame" will be a line of ... | Copyright 1995 - 1996 Regents of the University of California
Enhancements and Modifications Copyright 1998 - 2003 Pyxisystems LLC
8/04/03 fixed typo in deallocate - av - info
4/22/03 merged current LW and MCL files , no diffs , updated copyright
(in-package :boxer)
we simulate the behavior of a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.