_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 |
|---|---|---|---|---|---|---|---|---|
ec79505a5da24e0d020f447a3518c999a610ccf520223e07525d8a21213f97dd | pirapira/coq2rust | pptactic.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/printing/pptactic.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
ML Extensions
Tactic notations
*... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Names
open Nameg... |
209b505c26097788bc4a9fc0d50752fbe6d8f27614bdc9ed95312908332aa209 | ahf/ircd-scylla | message.ml |
* Copyright ( c ) 2015 . All rights reserved .
* Use of this source code is governed by a BSD - style
* license that can be found in the LICENSE file .
* Copyright (c) 2015 Alexander Færøy. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICE... | null | https://raw.githubusercontent.com/ahf/ircd-scylla/d06bfa61cd75a44c4f5493f316fba23143c32a78/message.ml | ocaml |
* Copyright ( c ) 2015 . All rights reserved .
* Use of this source code is governed by a BSD - style
* license that can be found in the LICENSE file .
* Copyright (c) 2015 Alexander Færøy. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICE... | |
d47a78bb2504369151a9cc06d25eebd9e1abf3c8de9365bddfe67d1d98c03951 | rtrusso/scp | globals.scm | (define *sasm-assemble-module-count* 0)
(define *sasm-assemble-symconst-alist*
'())
| null | https://raw.githubusercontent.com/rtrusso/scp/2051e76df14bd36aef81aba519ffafa62b260f5c/src/sasm/tx/globals.scm | scheme | (define *sasm-assemble-module-count* 0)
(define *sasm-assemble-symconst-alist*
'())
| |
ef67a85e7d5ce7970a3f6d89e227cf9d8f6c0280b605e172f0d979d0933ac60b | haskell-game/tiny-games-hs | peyton-says.hs | #!/usr/bin/env runhaskell
import System.IO;import Control.Concurrent;import Control.Monad;import GHC.Clock
import Data.Char;main=c>>m0>>hSetBuffering stdin NoBuffering>>getChar>>e""
p y=c>>mapM_ (\x->m1>>d 300000>>putStrLn [x]>>d 700000>>c) y>>e y
e y=mapM_(i y)y>>rnd>>= \x->p(y++[x]);c=putStr "\^[[2J\^[[H";d=threadDel... | null | https://raw.githubusercontent.com/haskell-game/tiny-games-hs/1fca44028454c5e18ed21883c2cbf32f233f03cf/base/peyton-says/peyton-says.hs | haskell | ^10 ------------------------------------------------------------------ 80> -- | #!/usr/bin/env runhaskell
import System.IO;import Control.Concurrent;import Control.Monad;import GHC.Clock
import Data.Char;main=c>>m0>>hSetBuffering stdin NoBuffering>>getChar>>e""
p y=c>>mapM_ (\x->m1>>d 300000>>putStrLn [x]>>d 700000>>c) y>>e y
e y=mapM_(i y)y>>rnd>>= \x->p(y++[x]);c=putStr "\^[[2J\^[[H";d=threadDel... |
587c5045d3edd4b68f8269baa3e2dc55aa7a087caa415459e051d6ed12caf0c6 | byulparan/cl-collider | slynk-extensions.lisp | (in-package #:cl-collider)
;; make sly show the synthdef's argument list for (synth ...)
(defmethod slynk::compute-enriched-decoded-arglist ((operator-form (eql 'synth)) argument-forms)
(let* ((fst (car argument-forms))
(controls (unless (typep fst 'slynk::arglist-dummy)
(synthdef-metad... | null | https://raw.githubusercontent.com/byulparan/cl-collider/1ad7f59c36acb61987e65973b77c5deb180285b1/slynk-extensions.lisp | lisp | make sly show the synthdef's argument list for (synth ...) | (in-package #:cl-collider)
(defmethod slynk::compute-enriched-decoded-arglist ((operator-form (eql 'synth)) argument-forms)
(let* ((fst (car argument-forms))
(controls (unless (typep fst 'slynk::arglist-dummy)
(synthdef-metadata (if (and (listp fst)
... |
4ed38425d23a101c2d0af8d1963b3c8efdb3edb380a9ab66910a5bbe80402a87 | grin-compiler/ghc-wpc-sample-programs | TikiWiki.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RelaxedPolyRec #
|
Module : Text . Pandoc . Readers . TikiWiki
Copyright : Copyright ( C ) 2017
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portabil... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/src/Text/Pandoc/Readers/TikiWiki.hs | haskell | # LANGUAGE OverloadedStrings #
utility functions
main parser
top
----
bottom
----
! header
return $ map (B.plain . mconcat) row
Tables:
||foo||
||row1-column1|row1-column2||row2-column1|row2-column2||
||row1-column1|row1-column2
row2-column1|row2-column2||
||row1-column1|row1-column2
row2-c... | # LANGUAGE FlexibleContexts #
# LANGUAGE RelaxedPolyRec #
|
Module : Text . Pandoc . Readers . TikiWiki
Copyright : Copyright ( C ) 2017
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable
Conversion of Tik... |
276e56b37c657d8888e7eba119fed3e37b492a445cdc1af7450f23dbd53e692e | tmattio/js-bindings | vscode_jsonrpc_encoding.ml | [@@@js.dummy "!! This code has been generated by gen_js_api !!"]
[@@@ocaml.warning "-7-32-39"]
[@@@ocaml.warning "-7-11-32-33-39"]
open Es2020
module FunctionContentEncoder =
struct
type t = Ojs.t
let rec t_of_js : Ojs.t -> t = fun (x2 : Ojs.t) -> x2
and t_to_js : t -> Ojs.t = fun (x1 : Ojs.t) -> x1
l... | null | https://raw.githubusercontent.com/tmattio/js-bindings/ca3bd6a12db519c8de7f41b303f14cf70cfd4c5f/lib/vscode-jsonrpc/vscode_jsonrpc_encoding.ml | ocaml | [@@@js.dummy "!! This code has been generated by gen_js_api !!"]
[@@@ocaml.warning "-7-32-39"]
[@@@ocaml.warning "-7-11-32-33-39"]
open Es2020
module FunctionContentEncoder =
struct
type t = Ojs.t
let rec t_of_js : Ojs.t -> t = fun (x2 : Ojs.t) -> x2
and t_to_js : t -> Ojs.t = fun (x1 : Ojs.t) -> x1
l... | |
473a77a560ccf24c8c4f2eaa9bb3d982b9ffb2b31eec220655d5d054a37e8e18 | fakedata-haskell/fakedata | Fallout.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Faker.Provider.Fallout where
import Config
import Control.Monad.Catch
import Control.Monad.IO.Class
import Data.Map.Strict (Map)
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Yaml
import Faker
import Fak... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/7b0875067386e9bb844c8b985c901c91a58842ff/src/Faker/Provider/Fallout.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Provider.Fallout where
import Config
import Control.Monad.Catch
import Control.Monad.IO.Class
import Data.Map.Strict (Map)
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Yaml
import Faker
import Faker.Internal
import Faker.Provider.T... |
be33fe8d8a6947fc8017f79177e9993421d33f69647747f898e8cd85ac3986d1 | funimagej/fun.imagej | local_area_coverage.clj | ; @ImagePlus(label="Target image",description="Input image (will be binarized)") segments
@Integer(label="Radius",description="Coverage within a ball of this radius will be analyzed . ",value=25 ) density - radius
(use '[fun.imagej img imp project conversion]
'[fun.imagej.segmentation utils imp]
'[f... | null | https://raw.githubusercontent.com/funimagej/fun.imagej/dcbe14581ba9394d8ecc6e254e02fac8130a942d/src/plugins/Scripts/Plugins/FunImageJ/SpatialAnalysis/local_area_coverage.clj | clojure | @ImagePlus(label="Target image",description="Input image (will be binarized)") segments | @Integer(label="Radius",description="Coverage within a ball of this radius will be analyzed . ",value=25 ) density - radius
(use '[fun.imagej img imp project conversion]
'[fun.imagej.segmentation utils imp]
'[fun.imagej.imp calibration roi threshold calculator statistics])
(let [density-radius (min... |
7c1f6d541969016962b7fb377a1ee7768d3e1bc19b5e21322bf522eb3fc6eb43 | metosin/fnhouse-swagger | swagger.clj | (ns ^:no-doc fnhouse.swagger
(:require
[plumbing.core :refer :all]
[ring.swagger.core :as ring-swagger]
[ring.swagger.ui :as ring-swagger-ui]
[clojure.set :refer [map-invert]]
[schema.core :as s]))
;;
;; Internals
;;
(defn- generate-nickname [annotated-handler]
(get-in annotated-handler [:info... | null | https://raw.githubusercontent.com/metosin/fnhouse-swagger/69cdd92a5bb6466dce0c35e369147d7a2b598533/src/fnhouse/swagger.clj | clojure |
Internals
Public API
Swagger 1.2 Endpoints
| (ns ^:no-doc fnhouse.swagger
(:require
[plumbing.core :refer :all]
[ring.swagger.core :as ring-swagger]
[ring.swagger.ui :as ring-swagger-ui]
[clojure.set :refer [map-invert]]
[schema.core :as s]))
(defn- generate-nickname [annotated-handler]
(get-in annotated-handler [:info :source-map :name]... |
5aeaba3d3c8016a2cdab82c0d2280f6556ba062e0aa26962ec55b062bcd744fa | mfoemmel/erlang-otp | wxPaintDC.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxPaintDC.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(wxPaintDC).
-include("wxe.hrl").
... |
337f666175ca662d260f94e1ec7ea16a72d8369a33f5beecd398c66edfb09f61 | avsm/eeww | source.ml | module Timer = struct
type t
external dispatch_source_timer_create : Queue.t -> t = "ocaml_dispatch_source_timer_create"
external dispatch_source_timer_set_event_handler : t -> (unit -> unit) -> unit = "ocaml_dispatch_source_timer_set_event_handler"
external dispatch_source_timer_start : t -> int64 -> unit = ... | null | https://raw.githubusercontent.com/avsm/eeww/ab64c5391b67fb3f5b1d3de5e0a5a5cb4c80207b/lib/dispatch/lib/source.ml | ocaml | module Timer = struct
type t
external dispatch_source_timer_create : Queue.t -> t = "ocaml_dispatch_source_timer_create"
external dispatch_source_timer_set_event_handler : t -> (unit -> unit) -> unit = "ocaml_dispatch_source_timer_set_event_handler"
external dispatch_source_timer_start : t -> int64 -> unit = ... | |
07276a156f6000da395fc967cdc1128ef80059ac89a31d4f286ad6e0619934d5 | hemmi/coq2scala | extrawit.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/hemmi/coq2scala/d10f441c18146933a99bf2088116bd213ac3648d/coq-8.4pl2/parsing/extrawit.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* This file defines extra argument t... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Util
open Genarg
open Ta... |
7c4cb2b6c914f4b492dcc225bb3c66831b2d0fe5c31c54e785551a7211d78262 | eeng/shevek | navigation.cljs | (ns shevek.navigation
(:require [secretary.core :as secretary :refer-macros [defroute]]
[pushy.core :as pushy]
[shevek.reflow.core :refer [dispatch] :refer-macros [defevh]]
[shevek.reflow.db :as db]
[shevek.lib.error :refer [show-page-404]]))
(defonce history
(pushy/... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/navigation.cljs | clojure | (ns shevek.navigation
(:require [secretary.core :as secretary :refer-macros [defroute]]
[pushy.core :as pushy]
[shevek.reflow.core :refer [dispatch] :refer-macros [defevh]]
[shevek.reflow.db :as db]
[shevek.lib.error :refer [show-page-404]]))
(defonce history
(pushy/... | |
26744da7c2195df036dad47a1c9ba99d581ae64c1fb557263db40111a3e0742c | mishun/tangles | Threads.hs | module Math.Topology.KnotTh.Knotted.Threads
( ThreadedCrossing(..)
, allThreads
, numberOfThreads
, allThreadsWithMarks
) where
import Control.Monad (foldM)
import qualified Control.Monad.ST as ST
import Data.Maybe (fromJust)
import Data.STRef (newSTRef, readSTRef, modifySTRef')
import qualified Da... | null | https://raw.githubusercontent.com/mishun/tangles/9af39dd48e3dcc5e3944f8d060c8769ff3d81d02/src/Math/Topology/KnotTh/Knotted/Threads.hs | haskell | module Math.Topology.KnotTh.Knotted.Threads
( ThreadedCrossing(..)
, allThreads
, numberOfThreads
, allThreadsWithMarks
) where
import Control.Monad (foldM)
import qualified Control.Monad.ST as ST
import Data.Maybe (fromJust)
import Data.STRef (newSTRef, readSTRef, modifySTRef')
import qualified Da... | |
9cdf5d397041a1cd65b75d2f40150c73c08e0ef4e90f79ca8b50398fffa60cab | tommaisey/aeon | b-allocRead.help.scm | Allocate buffer space and read a sound file .
; int - buffer number
; string - path name of a sound file.
; int - starting frame in file (optional. default = 0)
; int - number of frames to read (optional. default = 0, see below)
bytes - an OSC message to execute upon completion . ( optional )
; Alloca... | null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/server-command/b-allocRead.help.scm | scheme | int - buffer number
string - path name of a sound file.
int - starting frame in file (optional. default = 0)
int - number of frames to read (optional. default = 0, see below)
Allocates buffer to number of channels of file and number of samples
requested, or fewer if sound file is smaller than requested. Reads
so... | Allocate buffer space and read a sound file .
bytes - an OSC message to execute upon completion . ( optional )
number of frames argument is less than or equal to zero , the entire
|
58336e414699c2c85d3d83205e2fc7d34fb5f51de8b32dd9816b1447deb9dcc2 | edgecase/dieter | core.clj | (ns t3.test.core
(:use [t3.core])
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write
(is false "No tests have been written."))
| null | https://raw.githubusercontent.com/edgecase/dieter/f3c7cdd7703c6d1556e68bbe8fc94406b717f6f1/test-projects/t3/test/t3/test/core.clj | clojure | FIXME: write | (ns t3.test.core
(:use [t3.core])
(:use [clojure.test]))
(is false "No tests have been written."))
|
b17fb0869c2a573204dfb3fcd63a7bd0e2679014dec9bb753d1a128629f63eb7 | nibbula/yew | file-inator.lisp | ;;;
;;; file-inator.lisp - Inators that use files.
;;;
(defpackage :file-inator
(:documentation "Inators that use files.")
(:use :cl :dlib :inator :keymap :char-util)
(:export
;; Classes
#:file-inator
#:file-inator-file-name
Generic functions
#:next-file
#:previous-file
#:save-file
#:save-... | null | https://raw.githubusercontent.com/nibbula/yew/f88770bc0b09871ba9fffb6dfbdc317496322e74/inator/file-inator.lisp | lisp |
file-inator.lisp - Inators that use files.
Classes
File operations
This doesn't really have to be an inator specific thing, but it is useful
for them. The names of the restarts _do_ have to come from somewhere. |
(defpackage :file-inator
(:documentation "Inators that use files.")
(:use :cl :dlib :inator :keymap :char-util)
(:export
#:file-inator
#:file-inator-file-name
Generic functions
#:next-file
#:previous-file
#:save-file
#:save-as-file
#:revert-file
#:open-file
Macros
#:with-file-list
... |
b1a310f5a857fce3e8d53044a5eb7c211830adee9170dc834ec72deafc548f6d | tonyrog/canopen | co_format.erl | %%%---- BEGIN COPYRIGHT --------------------------------------------------------
%%%
Copyright ( C ) 2007 - 2012 , Rogvall Invest AB , < >
%%%
%%% This software is licensed as described in the file COPYRIGHT, which
%%% you should have received as part of this distribution. The terms
%%% are also available at .
%%%
%... | null | https://raw.githubusercontent.com/tonyrog/canopen/b76c0c3503e3087cc7511fe5795e6053702d449e/src/co_format.erl | erlang | ---- BEGIN COPYRIGHT --------------------------------------------------------
This software is licensed as described in the file COPYRIGHT, which
you should have received as part of this distribution. The terms
are also available at .
You may opt to use, copy, modify, merge, publish, distribute and/or sell
furn... | Copyright ( C ) 2007 - 2012 , Rogvall Invest AB , < >
copies of the Software , and permit persons to whom the Software is
This software is distributed on an " AS IS " basis , WITHOUT WARRANTY OF ANY
@author < >
( C ) 2010 ,
Created : 13 Feb 2009 by
-module(co_format).
-include_lib("can/include/can... |
2c722214de20359c0847bc2ff09bb7b3c1141b72e472691b1a7843478a4fbdf9 | Studio-kalavati/sargam-spec | project.clj | (defproject studiokalavati/sargam-spec "0.1.12"
:description "Clojure and json spec for Bhatkhande notation"
:url "-kalavati/sargam-spec"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:repositories [["releases" {:url ""
:userna... | null | https://raw.githubusercontent.com/Studio-kalavati/sargam-spec/5a727acb0b99549151333ba5c92ce9175f36b06d/project.clj | clojure | (defproject studiokalavati/sargam-spec "0.1.12"
:description "Clojure and json spec for Bhatkhande notation"
:url "-kalavati/sargam-spec"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:repositories [["releases" {:url ""
:userna... | |
653783195376d5a038314de7a1f6d24adbbb5233e328b7723938b67297e502e9 | atlas-engineer/nyxt | document-vector.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :analysis)
;;; document-vector.lisp: transform a document into a vector
(defmethod word-count-vectorize ((document document) dictionary)
"Transform a document into a vector using word counts."
(let ((vector... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/39429c7f6b61b1d1723b998e831c173a4c3ddb9b/libraries/analysis/document-vector.lisp | lisp | document-vector.lisp: transform a document into a vector | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :analysis)
(defmethod word-count-vectorize ((document document) dictionary)
"Transform a document into a vector using word counts."
(let ((vector-data (make-array (length dictionary) :initial-element 0)))
... |
bd73ae62d0e37302586933e528cc385fb79d37edd5e0ef51977206ed44354d5d | emqx/emqx | emqx_connector_http.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/699afc8c61ac2436f5a05e81fa66e2bf70b5580a/apps/emqx_connector/src/emqx_connector_http.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 ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_connector_http).
-include("emqx_connector.hrl").
-include_lib("typerefl/include/t... |
2c359d847971d080f57948a7f2f9516530064e8b2a68d5de7e4374362a4e238e | rd--/hosc | qc.hs | # LANGUAGE ScopedTypeVariables #
import Test.Framework {- test-framework -}
import Test.Framework.Providers.QuickCheck2 {- test-framework-quickcheck2 -}
import qualified Sound.Osc.Coding.Decode.Base as Base
import qualified Sound.Osc.Coding.Encode.Base as Base
import qualified Sound.Osc.Coding.Decode.Binary as Defaul... | null | https://raw.githubusercontent.com/rd--/hosc/b96b0044546228efb08dd53a11c3f109edb88e6a/contrib/tests/qc.hs | haskell | test-framework
test-framework-quickcheck2 | # LANGUAGE ScopedTypeVariables #
import qualified Sound.Osc.Coding.Decode.Base as Base
import qualified Sound.Osc.Coding.Encode.Base as Base
import qualified Sound.Osc.Coding.Decode.Binary as Default
import qualified Sound.Osc.Coding.Encode.Builder as Default
import Sound.Osc.Arbitrary ()
are_eq :: Eq a => (t -> a)... |
5cb5a30968ee1fca55d807bde81cb3f37ae46e7334533e3b312e63357cb1bc2c | garrigue/lablgtk | searchpos.ml | (**************************************************************************)
(* Lablgtk - Applications *)
(* *)
(* * You are free to do anything you want with this code as long *)
(* as i... | null | https://raw.githubusercontent.com/garrigue/lablgtk/504fac1257e900e6044c638025a4d6c5a321284c/applications/browser/searchpos.ml | ocaml | ************************************************************************
Lablgtk - Applications
* You are free to do anything you want with this code as long
as it is for personal ... | < >
< >
< >
< >
< >
< >
$ Id$
open StdLabels
open Parsetree
open Typedtree
open Types
open ... |
5ad2423aff6fc53f3c228050056002adf4681043069d2d9349c96bd45bacc091 | hoodunit/grub | websocket.clj | (ns grub.websocket
(:require [org.httpkit.server :as httpkit]
[clojure.core.async :as a :refer [<! >! chan go]]
[cognitect.transit :as t])
(:import [java.io ByteArrayInputStream ByteArrayOutputStream]))
(def DEBUG false)
(defn write-msg [msg]
(let [out (ByteArrayOutputStream. 4096)
... | null | https://raw.githubusercontent.com/hoodunit/grub/6e47218c34a724d1123717997eac5e196a5bba9b/src/clj/grub/websocket.clj | clojure | (ns grub.websocket
(:require [org.httpkit.server :as httpkit]
[clojure.core.async :as a :refer [<! >! chan go]]
[cognitect.transit :as t])
(:import [java.io ByteArrayInputStream ByteArrayOutputStream]))
(def DEBUG false)
(defn write-msg [msg]
(let [out (ByteArrayOutputStream. 4096)
... | |
1092a86943121593c48cea9bb58619e7489731b243a2f815b5cde34c0a2c6499 | inria-parkas/sundialsml | kinsol_skel.ml | open Sundials
1 . Define a system function .
let pi, e = 4. *. atan 1., exp 1.
let sysf u r =
r.{0} <- 0.5 *. sin(u.{0}*.u.{1}) -. 0.25 *. u.{1} /. pi -. 0.5 *. u.{0};
r.{1} <- (1. -. 0.25/.pi)*.(exp(2.*.u.{0})-.e) +. e*.u.{1}/.pi -. 2.*.e*.u.{0};
r.{2} <- u.{2} -. u.{0} +. 0.25;
r.{3} <- u.{3} -. u.{0} +. 1... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/0c46b0c6c067677af6ef8006260b9e697cc0562b/examples/ocaml/skeletons/kinsol_skel.ml | ocaml | open Sundials
1 . Define a system function .
let pi, e = 4. *. atan 1., exp 1.
let sysf u r =
r.{0} <- 0.5 *. sin(u.{0}*.u.{1}) -. 0.25 *. u.{1} /. pi -. 0.5 *. u.{0};
r.{1} <- (1. -. 0.25/.pi)*.(exp(2.*.u.{0})-.e) +. e*.u.{1}/.pi -. 2.*.e*.u.{0};
r.{2} <- u.{2} -. u.{0} +. 0.25;
r.{3} <- u.{3} -. u.{0} +. 1... | |
e4d1cec926be7fd11673cbcdad1175195d0245dafb9a6700bf28d985449c73bc | PrincetonUniversity/lucid | CoreSyntax.ml | Abstract core syntax of Lucid -- this is the part that remains after all the
frontend transformations have eliminated the rest of it .
frontend transformations have eliminated the rest of it. *)
open Batteries
type id = [%import: (Id.t[@opaque])]
and cid = [%import: (Cid.t[@opqaue])]
and sp = [%import: Spa... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/8ca93fd803caaa80cf2e301154791564dd3fed7e/src/lib/midend/CoreSyntax.ml | ocaml | All sizes should be inlined and precomputed
Number of bits
Only used for Array/event functions at this point
values
Stage number
Only used in the interpreter during complex memops
expressions
for convenience
statements
out_tys set for statements that create new vars
table entries are patterns that ... | Abstract core syntax of Lucid -- this is the part that remains after all the
frontend transformations have eliminated the rest of it .
frontend transformations have eliminated the rest of it. *)
open Batteries
type id = [%import: (Id.t[@opaque])]
and cid = [%import: (Cid.t[@opqaue])]
and sp = [%import: Spa... |
8489f07028bf69e560e1ee84070f7f130a2c9c9e849dc8726df3053c4b1ebca3 | seckcoder/course-compiler | r4_9.rkt | (define (mapint [fun : (Integer -> Integer)] [v : (Vector Integer Integer Integer)])
: (Vector Integer Integer Integer)
(vector (fun (vector-ref v 0)) (fun (vector-ref v 1)) (fun (vector-ref v 2))))
(define (add1 [x : Integer]) : Integer
(+ x 1))
(let ([vec (vector 1 2 3)])
(let ([vec2 (mapint add1 vec)])
(... | null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/student-tests/r4_9.rkt | racket | (define (mapint [fun : (Integer -> Integer)] [v : (Vector Integer Integer Integer)])
: (Vector Integer Integer Integer)
(vector (fun (vector-ref v 0)) (fun (vector-ref v 1)) (fun (vector-ref v 2))))
(define (add1 [x : Integer]) : Integer
(+ x 1))
(let ([vec (vector 1 2 3)])
(let ([vec2 (mapint add1 vec)])
(... | |
6de3169a4ddd5b3f12f17ab5e2d0f88c12f2212c99bcfe84686e493567f12a51 | dQuadrant/kuber | TxBuilderAeson.hs | # LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
module Cardano.Kuber.Data.TxBuilderAeson
wher... | null | https://raw.githubusercontent.com/dQuadrant/kuber/af5f758fa8660a64135dcece8b07b355dd9e866d/src/Cardano/Kuber/Data/TxBuilderAeson.hs | haskell | # LANGUAGE DoAndIfThenElse #
# LANGUAGE OverloadedStrings #
then use address with value TxOutAddress otherwise use TxOutScriptAddress or TxOutScript
which has script and data if there is no script given then take address
as script address and get data hash from the datum or directly from dataHash
if there is script... | # LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
module Cardano.Kuber.Data.TxBuilderAeson
where
import Cardano.Api hiding(txMetadata, txFee)
import Cardano.Api.... |
669c7c62a309f1f7c36b0eb05805ab2e82ce02167d13825295702d3325afca97 | modular-macros/ocaml-macros | bswap.ml | open Printf
external bswap16: int -> int = "%bswap16"
external bswap32: int32 -> int32 = "%bswap_int32"
external bswap64: int64 -> int64 = "%bswap_int64"
let d16 = [0x11223344;
0x0000f0f0]
let d32 = [0x11223344l;
0xf0f0f0f0l]
let d64 = [0x1122334455667788L;
0xf0f0f0f0f0f0f0f0L]
let _... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/prim-bswap/bswap.ml | ocaml | open Printf
external bswap16: int -> int = "%bswap16"
external bswap32: int32 -> int32 = "%bswap_int32"
external bswap64: int64 -> int64 = "%bswap_int64"
let d16 = [0x11223344;
0x0000f0f0]
let d32 = [0x11223344l;
0xf0f0f0f0l]
let d64 = [0x1122334455667788L;
0xf0f0f0f0f0f0f0f0L]
let _... | |
f9445659e38ccb24cc1de7750f75b4c2dc0504482f9b4c8bba738013e1245beb | tolysz/ghcjs-stack | test-TestOptions.hs | module Main where
import System.Environment ( getArgs )
import System.Exit ( exitFailure, exitSuccess )
main :: IO ()
main = do
args <- getArgs
if args == ["1", "2", "3"]
then exitSuccess
else putStrLn ("Got: " ++ show args) >> exitFailure
| null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal/Cabal/tests/PackageTests/TestOptions/test-TestOptions.hs | haskell | module Main where
import System.Environment ( getArgs )
import System.Exit ( exitFailure, exitSuccess )
main :: IO ()
main = do
args <- getArgs
if args == ["1", "2", "3"]
then exitSuccess
else putStrLn ("Got: " ++ show args) >> exitFailure
| |
1202c5e25c80459364b40be48e131d33d590f212e21eb2ce6aa21cbb44cf6154 | chunsj/TH | nalu.lisp | ;; from
;; -tf/blob/master/nalu.py
;;
;; Neural Arithmetic Logic Units
;; Refer -
(defpackage :nalu-work
(:use #:common-lisp
#:mu
#:th))
(in-package :nalu-work)
;; XXX
;; for this kind of problem, we may need more accurate tensor data than float
;; sometimes, the computation emits overflow error.
... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/examples/nalu/nalu.lisp | lisp | from
-tf/blob/master/nalu.py
Neural Arithmetic Logic Units
Refer -
XXX
for this kind of problem, we may need more accurate tensor data than float
sometimes, the computation emits overflow error.
generate
check training accuracy
check test accuracy - generate new data
okay, check with new data - |
(defpackage :nalu-work
(:use #:common-lisp
#:mu
#:th))
(in-package :nalu-work)
(defparameter *batch-size* 10)
(defparameter *shape* (list 2 1))
(defparameter *dataset* nil)
(defparameter *target* nil)
(defparameter *operation* #'*)
(loop :for n :from 0 :below 100
:do (let ((args (tensor *... |
08125aca11b15520447b310ef64fe69817ee47ae94fe3569f5fb9dee1f75750a | turtlesoupy/haskakafka | Simple.hs | import Haskakafka
import qualified Data.ByteString.Char8 as C8
-- | Attempts to connect to kafka at localhost:9092. If you want to specify
main :: IO ()
main = do
let
brokerNames = "localhost:9092"
ourTopic = "test_topic"
Optionally , we can configure certain parameters for
kafkaConfig = [("s... | null | https://raw.githubusercontent.com/turtlesoupy/haskakafka/cae3348be1a3934629cf58d433c224d87ff59608/example/Simple.hs | haskell | | Attempts to connect to kafka at localhost:9092. If you want to specify
withKafkaProducer opens a producer connection and gives us
Produce a single keyed message
We can also use the batch API for better performance
withKafkaConsumer opens a consumer connection and starts consuming
locked to a specific partition ... | import Haskakafka
import qualified Data.ByteString.Char8 as C8
main :: IO ()
main = do
let
brokerNames = "localhost:9092"
ourTopic = "test_topic"
Optionally , we can configure certain parameters for
kafkaConfig = [("socket.timeout.ms", "50000")]
topicConfig = [("request.timeout.ms", "50... |
95fcfacfbe7681ca117cda40db62039e377289068e316d86c6a7db5beef3dea5 | fukamachi/lsx | template.lisp | (defpackage #:lsx/template
(:use #:cl)
(:import-from #:lsx/html
#:render-object)
(:import-from #:closer-mop)
(:export #:template
#:template-class
#:deftemplate
#:render))
(in-package #:lsx/template)
(defclass template () ())
(defmethod render-object ((object te... | null | https://raw.githubusercontent.com/fukamachi/lsx/8eea08b678f57f5b72ce76de7effb4f279d2510f/template.lisp | lisp | (defpackage #:lsx/template
(:use #:cl)
(:import-from #:lsx/html
#:render-object)
(:import-from #:closer-mop)
(:export #:template
#:template-class
#:deftemplate
#:render))
(in-package #:lsx/template)
(defclass template () ())
(defmethod render-object ((object te... | |
6226dbdd1d3d2dc7487c6a69c8cf1594b7224f521eacdef902ca1dcb35e3b3db | pkhuong/bitap-regexp | scalar-bitap.lisp | (defpackage "SCALAR-BITAP"
(:use "CL")
(:import-from "REGEXP-TO-NFA"
"COMPRESSED-NFA" "COMPRESSED-NFA-ID-COUNT"
"COMPRESSED-NFA-CHARACTER-TRANSITIONS" "COMPRESSED-NFA-EPSILONS-ADJACENCY"
"COMPRESSED-NFA-START-IDS" "COMPRESSED-NFA-ACCEPT-IDS")
(:import-from "ALEXANDR... | null | https://raw.githubusercontent.com/pkhuong/bitap-regexp/b24beb2dd74e4f79263f3f8f5d09199f16dc9c34/scalar-bitap.lisp | lisp | adjacency lists are sorted
merge identical rows (modulo diagonal)
Try to merge in patterns like
i -> {j, k}
x -> {i, j, k}
not a noop
alone
and could be coupled
map shift amount -> origin states
if t, higher-valued states are at lower order bits | (defpackage "SCALAR-BITAP"
(:use "CL")
(:import-from "REGEXP-TO-NFA"
"COMPRESSED-NFA" "COMPRESSED-NFA-ID-COUNT"
"COMPRESSED-NFA-CHARACTER-TRANSITIONS" "COMPRESSED-NFA-EPSILONS-ADJACENCY"
"COMPRESSED-NFA-START-IDS" "COMPRESSED-NFA-ACCEPT-IDS")
(:import-from "ALEXANDR... |
1df026a707b01bad906ce4beec18c9de38ac6e8d389612289345a7121e62b80a | Chadtech/elmish-wasm | Data.hs | module Module.Data
( Model(..)
, Part(..)
, Exposing(..)
)
where
import qualified Function
data Model =
Ctor
{ name :: String
, exposing :: Exposing
, parts :: [ Part ]
}
data Exposing
= All
| Only [ String ]
data Part
= FunctionTypeSignature
| Function F... | null | https://raw.githubusercontent.com/Chadtech/elmish-wasm/001463453ffbc2a6bc21803b00b7ed242ad4ffbd/src/Module/Data.hs | haskell | module Module.Data
( Model(..)
, Part(..)
, Exposing(..)
)
where
import qualified Function
data Model =
Ctor
{ name :: String
, exposing :: Exposing
, parts :: [ Part ]
}
data Exposing
= All
| Only [ String ]
data Part
= FunctionTypeSignature
| Function F... | |
580f7747856b296a632338416e5543ffec97ddfe578da826d55d9b7b677affe6 | bgamari/the-thoralf-plugin | Symbol.hs | {-# OPTIONS_GHC -Wunused-top-binds #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeOperators #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE UndecidableInstances #
# LANGUAGE AllowAmbig... | null | https://raw.githubusercontent.com/bgamari/the-thoralf-plugin/fa4e403b25bfcaf9e8d5142ab40d3c54b33a3630/src/ThoralfPlugin/Singletons/Symbol.hs | haskell | # OPTIONS_GHC -Wunused-top-binds #
# LANGUAGE TypeInType #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# LANGUAGE ConstraintKinds #
Forcing Constraints | # LANGUAGE TypeFamilies #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TypeApplications #
module ThoralfPlugin.Singletons.Symbol
( SSymbol (..)
, scomp
)
where
import ThoralfPlugin.Theory.Dis... |
d317143996d54154d24ad0af680bb859053496a6c1e33e0385a02190ef6acfa5 | eugeneia/athens | util.lisp | (in-package :cl-user)
(defpackage jonathan-test.util
(:use :cl
:prove
:jonathan.util))
(in-package :jonathan-test.util)
(plan 3)
(subtest "my-plist-p"
(ok (my-plist-p '(:key1 :value1)))
(ok (my-plist-p '(:key1 :value1 :key2)))
(ok (my-plist-p '(:key1 :value1 :key2 :value2)))
(ok (my-plist-p ... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/jonathan-20180430-git/t/util.lisp | lisp | (in-package :cl-user)
(defpackage jonathan-test.util
(:use :cl
:prove
:jonathan.util))
(in-package :jonathan-test.util)
(plan 3)
(subtest "my-plist-p"
(ok (my-plist-p '(:key1 :value1)))
(ok (my-plist-p '(:key1 :value1 :key2)))
(ok (my-plist-p '(:key1 :value1 :key2 :value2)))
(ok (my-plist-p ... | |
7832b9775dd55fb341b8eed087530e7a53eaa6248eaca8100500147acf8d493a | Ericson2314/lighthouse | HaskTags.hs | module Main where
import Char
import List
import IO
import System.Environment
import System.Console.GetOpt
import System.Exit
-- search for definitions of things
-- we do this by looking for the following patterns:
-- data XXX = ... giving a datatype location
-- newtype XXX = ... giving a newtype location
-- ... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/ghc-6.8.2/utils/hasktags/HaskTags.hs | haskell | search for definitions of things
we do this by looking for the following patterns:
data XXX = ... giving a datatype location
newtype XXX = ... giving a newtype location
bla :: ... giving a function location
by doing it this way, we avoid picking up local definitions
(whether this is good or n... | module Main where
import Char
import List
import IO
import System.Environment
import System.Console.GetOpt
import System.Exit
We generate both CTAGS and ETAGS format tags files
The former is for use in most sensible editors , while EMACS uses ETAGS
main :: IO ()
main = do
progName <- getProgName
args ... |
4c9903d9fc8ef1be9490126a57dfcab0e2949488f9db8f16ef3973172076de96 | onyx-platform/learn-onyx | challenge_0_0.clj | (ns workshop.challenge-0-0
(:require [workshop.workshop-utils :as u]))
Workflows ; ; ;
(def workflow
[[:read-segments :no-transform]
[:no-transform :write-segments]])
;;; Catalogs ;;;
(defn build-catalog
([] (build-catalog 5 50))
([batch-size batch-timeout]
[{:onyx/name :read-segments
:onyx... | null | https://raw.githubusercontent.com/onyx-platform/learn-onyx/6bf1936f35d26e3c8cf171b5971e1bc95e82b3c8/src/workshop/challenge_0_0.clj | clojure | ; ;
Catalogs ;;;
Functions ;;;
; ; | (ns workshop.challenge-0-0
(:require [workshop.workshop-utils :as u]))
(def workflow
[[:read-segments :no-transform]
[:no-transform :write-segments]])
(defn build-catalog
([] (build-catalog 5 50))
([batch-size batch-timeout]
[{:onyx/name :read-segments
:onyx/plugin :onyx.plugin.core-async/inp... |
a2a741a98ccf1b02b3151898bbc63c582b5c383afb402937b2529cedc61ea732 | dtgoitia/civil-autolisp | ImportManholeBlocks.lsp | ; (defun c:xx ()
; ; Trigger
( DT : AutoLoadFileFromCivilTemp " ImportManholeBlocks.lsp " )
( c : )
;
; v0.0 - 2017.07.28 - First issue
; Author :
; Last revision : 2017.07.28
; )
(DT:AutoLoadFileFromCivilTemp "SplitString.lsp")
(DT:AutoLoadFileFromCivilTemp "LmAttributeFunctions.lsp")
(defun c... | null | https://raw.githubusercontent.com/dtgoitia/civil-autolisp/72d68139d372c84014d160f8e4918f062356349f/Dump%20folder/ImportManholeBlocks.lsp | lisp | (defun c:xx ()
; Trigger
v0.0 - 2017.07.28 - First issue
Author :
Last revision : 2017.07.28
)
Select foul or storm settings
END subcond
END subcond
If not storm or foul, abort function
END cond
Insert block
Insert block with default values
Format correctly the manhole box properties
END list
END if
END... | ( DT : AutoLoadFileFromCivilTemp " ImportManholeBlocks.lsp " )
( c : )
(DT:AutoLoadFileFromCivilTemp "SplitString.lsp")
(DT:AutoLoadFileFromCivilTemp "LmAttributeFunctions.lsp")
(defun c:ImportManholeBlock ( / attributeList blockName blockLayer )
This program was written to pass non standard manholes ( with ... |
d40899b3f1a0835b49b5452ac141f7bc455cb6856f43a54296daee8ef3de9ea0 | mzp/coq-ruby | tactic_printer.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/parsing/tactic_printer.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
These are the entry points for ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : tactic_printer.ml... |
1586eca647421de9a6262911c3d9ec8cfd667785451475f4df8368e4c89ba58b | gadfly361/rid3 | viz.cljs | (ns rid3.viz
(:require
[reagent.core :as reagent]
[rid3.main-container :as main-container]
[rid3.pieces :as pieces]
[rid3.svg :as svg]))
(defn component-render [opts]
(let [{:keys [id
ratom
class]} opts
_trigger-update @ratom]
[:div {:id id :class class}]))
... | null | https://raw.githubusercontent.com/gadfly361/rid3/cae79fdbee3b5aba45e29b589425f9a17ef8613b/src/main/rid3/viz.cljs | clojure | TODO: remove notice in v0.3.0 | (ns rid3.viz
(:require
[reagent.core :as reagent]
[rid3.main-container :as main-container]
[rid3.pieces :as pieces]
[rid3.svg :as svg]))
(defn component-render [opts]
(let [{:keys [id
ratom
class]} opts
_trigger-update @ratom]
[:div {:id id :class class}]))
... |
fb0abea6f76e3fe683a1ed1fc7b8b99deda315511a99618d41a8105f731889bb | kappelmann/engaging-large-scale-functional-programming | Exercise05.hs | module Exercise05 where
-- here you could add additional programming exercises
| null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/17db9fbcb27d28a9496f4c696eada8f9f9c1ecdd/resources/cyp_integration/template/src/Exercise05.hs | haskell | here you could add additional programming exercises | module Exercise05 where
|
3ae3297e68afc72bbc6dc90aff4d56c425df11f0985dfb813bba01ad235161a1 | nandor/llir-ocaml | t190-makefloatblock-2.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
let x = 0.0 in [| x; x |];;
*
0 CONSTINT 42
2 PU... | null | https://raw.githubusercontent.com/nandor/llir-ocaml/9c019f15c444e30c825b1673cbe827e0497868fe/testsuite/tests/tool-ocaml/t190-makefloatblock-2.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
let x = 0.0 in [| x; x |];;
*
0 CONSTINT 42
2 PU... | |
6244b4d80f2eb9e39585b0af56510e31776b01a4f876c5247481b448938a5279 | xh4/web-toolkit | package.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; SPLIT-SEQUENCE
;;;
This code was based on in
;;; <URL:>;
;;;
;;; changes include:
;;;
;;; * altering the behaviour of the :from-end keyword argument to
;;; return the subsequences in original order, for consistency with
CL : REMOVE , CL : SUBSTITUTE et al . ... | null | https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/vendor/split-sequence-v2.0.0/package.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
SPLIT-SEQUENCE
<URL:>;
changes include:
* altering the behaviour of the :from-end keyword argument to
return the subsequences in original order, for consistency with
affects the answer if :count is less than the number of
subsequences, by analogy with the above-refe... | This code was based on in
CL : REMOVE , CL : SUBSTITUTE et al . (: from - end being non - NIL only
with CL : REMOVE , CL : SUBSTITUTE , and so on .
* The second return value is now an index rather than a copy of a
CL : SUBSEQ for continued processing .
CL : POSITION functions .
(defpackage #:split-sequ... |
867d7d29efa409c1d7726e5455bb5c5d340001b8ff28c62724e338e1c9071802 | fourmolu/fourmolu | overloaded-labels-four-out.hs | # LANGUAGE OverloadedLabels #
foo = #field
bar = (#this) (#that)
| null | https://raw.githubusercontent.com/fourmolu/fourmolu/1f8903a92c8d5001dc1ec8ecfd4a04a3b61c3283/data/examples/declaration/value/function/overloaded-labels-four-out.hs | haskell | # LANGUAGE OverloadedLabels #
foo = #field
bar = (#this) (#that)
| |
fe5c3aebc83de4ffcff4169dfa90045e878d98a6896a4bf0af1f2c66492bb908 | cachix/cachix | Main.hs | # LANGUAGE DuplicateRecordFields #
module Main
( main,
)
where
import Cachix.API.Error (escalateAs)
import qualified Cachix.API.WebSocketSubprotocol as WSS
import qualified Cachix.Client.URI as URI
import qualified Cachix.Deploy.Activate as Activate
import qualified Cachix.Deploy.Agent as Agent
import Cachix.Depl... | null | https://raw.githubusercontent.com/cachix/cachix/f5b5910826710f6b1f9d230576be1d0ed41e60fd/cachix/cachix-deployment/Main.hs | haskell | | Activate the new deployment.
If the target profile is already locked by another deployment, exit
immediately and rely on the backend to reschedule.
Open a connection to logging stream
Open a connection to Cachix and block until it's ready.
| Run the deployment commands
| Logging context
| Deployment informat... | # LANGUAGE DuplicateRecordFields #
module Main
( main,
)
where
import Cachix.API.Error (escalateAs)
import qualified Cachix.API.WebSocketSubprotocol as WSS
import qualified Cachix.Client.URI as URI
import qualified Cachix.Deploy.Activate as Activate
import qualified Cachix.Deploy.Agent as Agent
import Cachix.Depl... |
56f4b619cdbc530345e65ede73f13f7876488a59a6404b934c69602958db8a29 | ryanpbrewster/haskell | P178Test.hs | module Problems.P178Test
( case_178_main
) where
import Problems.P178
import Test.Tasty.Discover (Assertion, (@?=))
case_178_main :: Assertion
case_178_main = solve @?= "233168"
| null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/tests/Problems/P178Test.hs | haskell | module Problems.P178Test
( case_178_main
) where
import Problems.P178
import Test.Tasty.Discover (Assertion, (@?=))
case_178_main :: Assertion
case_178_main = solve @?= "233168"
| |
7113f884873b8b1ebb104ac992476eea20f9e57acc4db85a396c38ea77fb62e1 | snoyberg/why-you-should-use-stm | solution.hs | #!/usr/bin/env stack
-- stack --resolver lts-13.21 script
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.Wai.Parse
import Network.Wai.Handler.Warp
import Network.HTTP.Types
import Control.Concurrent.STM
import Data.ByteString.Builder (byteString)
import Control.Concurrent (threadDelay)
import GHC.... | null | https://raw.githubusercontent.com/snoyberg/why-you-should-use-stm/adf3366aebd6daf1dd702ed4cad1c2303d296afc/exercises/10-long-polling/solution.hs | haskell | stack --resolver lts-13.21 script
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
import Network.Wai
import Network.Wai.Parse
import Network.Wai.Handler.Warp
import Network.HTTP.Types
import Control.Concurrent.STM
import Data.ByteString.Builder (byteString)
import Control.Concurrent (threadDelay)
import GHC.Conc
main :: IO ()
main = do
tvar <- newTVarIO "Initial status"
ru... |
8eae69f555138d9a769557e10f65d1a0316dc8dafa54b0af004df96bf07f09c9 | deadcode/Learning-CL--David-Touretzky | 9.10.lisp | (defun space-over (n)
(cond ((zerop n) nil)
((not (plusp n)) (format t "Error!"))
(t (format t " ")(space-over (- n 1)))))
(defun test-space-over (n)
(format t "~%>>>")
(space-over n)
(format t "<<<"))
(defun plot-one-point (str col)
(format t "~%")
(space-over col)
(format ... | null | https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%209/9.10.lisp | lisp | (dribble)
| (defun space-over (n)
(cond ((zerop n) nil)
((not (plusp n)) (format t "Error!"))
(t (format t " ")(space-over (- n 1)))))
(defun test-space-over (n)
(format t "~%>>>")
(space-over n)
(format t "<<<"))
(defun plot-one-point (str col)
(format t "~%")
(space-over col)
(format ... |
127f95de12e836b476fdb88f3437e517b248fe25bf9cda164d4a3ec4d630fdca | jesperes/aoc_erlang | aoc2019_day01.erl | -module(aoc2019_day01).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2019,
day = 1,
name = "The Tyranny of the Rocket Equation",
... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/ec0786088fb9ab886ee57e17ea0149ba3e91810a/src/2019/aoc2019_day01.erl | erlang | -module(aoc2019_day01).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2019,
day = 1,
name = "The Tyranny of the Rocket Equation",
... | |
4351128730b6e7291fe8f8e61a7e50358d5cbc363d1167ebfb2b3f1e718c70a0 | robert-stuttaford/bridge | api_test.clj | (ns bridge.event.api-test
(:require [bridge.data.slug :as slug]
[bridge.event.api :as event.api]
[bridge.event.data :as event.data]
[bridge.event.schema :as event.schema]
[bridge.test.fixtures :as fixtures :refer [TEST-CHAPTER-ID TEST-PERSON-ID]]
[bridge.tes... | null | https://raw.githubusercontent.com/robert-stuttaford/bridge/867d81354457c600cc5c25917de267a8e267c853/test/bridge/event/api_test.clj | clojure | (ns bridge.event.api-test
(:require [bridge.data.slug :as slug]
[bridge.event.api :as event.api]
[bridge.event.data :as event.data]
[bridge.event.schema :as event.schema]
[bridge.test.fixtures :as fixtures :refer [TEST-CHAPTER-ID TEST-PERSON-ID]]
[bridge.tes... | |
b9ba0c76a0214a7415457bde804b404b0507f186fa3c2ef3458c20ce2036f0e7 | juxt/shop | foo.clj | (ns juxt.crux.demo.foo
(:require
crux.api
[yada.yada :as yada]
[integrant.core :as ig]))
(def id #uuid "50005565-299f-4c08-86d0-b1919bf4b7a9")
(defmethod ig/init-key ::read-write
[_ {:keys [system]}]
(yada/resource
{:id ::read-write
:methods
{:get
{:produces ["text/html" "applica... | null | https://raw.githubusercontent.com/juxt/shop/c23fc55bca1852bfbabb681a72debc12373c3a36/examples/juxt.crux.demo/src/juxt/crux/demo/foo.clj | clojure | To populate data using cURL: | (ns juxt.crux.demo.foo
(:require
crux.api
[yada.yada :as yada]
[integrant.core :as ig]))
(def id #uuid "50005565-299f-4c08-86d0-b1919bf4b7a9")
(defmethod ig/init-key ::read-write
[_ {:keys [system]}]
(yada/resource
{:id ::read-write
:methods
{:get
{:produces ["text/html" "applica... |
f498e99ed2417fae9995d502555be6b73977579df38fcf6d0be1425a9991f809 | oswald2/DGPatchMaker | MainWindow.hs | module Gtk.MainWindow
where
import Graphics.UI.Gtk
import Data . Text
import Data.IORef
import Data.Vector
import Gtk.Drumkit
import Gtk.InstrumentFrame
data MainWindow = MainWindow {
guiWindow :: Window,
guiNotebook :: Notebook,
guiNotebookInstruments :: Notebook,
guiInstrumentPages :: IORef (Vecto... | null | https://raw.githubusercontent.com/oswald2/DGPatchMaker/0e10acc680b0c2b7446693c25e356763a8806afc/src/Gtk/MainWindow.hs | haskell | module Gtk.MainWindow
where
import Graphics.UI.Gtk
import Data . Text
import Data.IORef
import Data.Vector
import Gtk.Drumkit
import Gtk.InstrumentFrame
data MainWindow = MainWindow {
guiWindow :: Window,
guiNotebook :: Notebook,
guiNotebookInstruments :: Notebook,
guiInstrumentPages :: IORef (Vecto... | |
ee5a0cd85ceb4fd9e26104a1891c5bfeeb7a4b26ccf688e88180bc8423329b7b | dmitryvk/sbcl-win32-threads | show.lisp | ;;;; some stuff for displaying information for debugging/experimenting
;;;; with the system, mostly conditionalized with #!+SB-SHOW
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/code/show.lisp | lisp | some stuff for displaying information for debugging/experimenting
with the system, mostly conditionalized with #!+SB-SHOW
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
various SB-SHOW-dep... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!INT")
programming when possible , and then set Emacs to display comments
in one shade of blue , tracing... |
f0c3e5e3d240e4cce4a3ae3caba89b5cde50f230f9c0b5e84116a48c771f49bc | OCamlPro/ocp-build | fileGen.mli | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-file/fileGen.mli | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
open OcpCompat
include (FileSig.FILE_OPERATIONS)
val equal : t -> t -> bool
val to_string : t -> string
val of_string : string -> t
val of_unix_string : string ->... |
9a22a98e083fbb1b20751465c52799d4f1403ef37a447cce44e36418f0923dc0 | janestreet/core | deque.mli |
* A double - ended queue that can shrink and expand on both ends .
An index is assigned to an element when it enters the queue , and the index of an
element is static ( i.e. , an index refers to a distinct element until that element is
removed from the queue , no matter how many intervening push / p... | null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/deque.mli | ocaml | * [front_index t] return the index of the front item in [t].
* [front_index_exn t] throws an exception if [t] is empty, otherwise returns the index
of the front item in [t].
* [back_index t] return the index of the back item in [t].
* [back_index_exn t] throws an exception if [t] is empty, otherwise returns the ... |
* A double - ended queue that can shrink and expand on both ends .
An index is assigned to an element when it enters the queue , and the index of an
element is static ( i.e. , an index refers to a distinct element until that element is
removed from the queue , no matter how many intervening push / p... |
b8ac1d79ea9fecd0f1920c85871100a22d6f7e2c9459590c67fc23313b6d7f86 | takikawa/racket-ppa | readtable.rkt | #lang racket/base
(require "../common/inline.rkt"
"../common/parameter-like.rkt"
"config.rkt"
"coerce.rkt"
"parameter.rkt"
"readtable-parameter.rkt"
"special-comment.rkt")
(provide readtable-delimiter-ht
make-readtable
readtable?
readtabl... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/src/expander/read/readtable.rkt | racket | parser for default token handling: symbol-or-number
The character table maps characters to either a
parsing function or another character whose
default to use
The dispatch table maps character for `#` dispatch
The delimiter table maps a character to 'delimit,
'no-delimit, or a character whose default to use;
ab... | #lang racket/base
(require "../common/inline.rkt"
"../common/parameter-like.rkt"
"config.rkt"
"coerce.rkt"
"parameter.rkt"
"readtable-parameter.rkt"
"special-comment.rkt")
(provide readtable-delimiter-ht
make-readtable
readtable?
readtabl... |
826b0d46a06cdce78c9d44ad3ef74b7ed8abca5ccb2795f20f46225fe80107d8 | merijn/Belewitte | V5.hs | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE QuasiQuotes #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableIn... | null | https://raw.githubusercontent.com/merijn/Belewitte/cab6010a2bc54acfc4f4b169c95799fe455799ef/benchmark-analysis/src/Schema/Model/V5.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE QuasiQuotes #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Schema... |
a293c81f46fed5f7eeb989cf58f9f66d17253bf9c48128d8d534ea7a1e5117b3 | ptaoussanis/sente | undertow.clj | (ns taoensso.sente.server-adapters.community.undertow
"Sente server adapter for ring-undertow-adapter."
{:author "Nik Peric"}
(:require
[ring.adapter.undertow.websocket :as websocket]
[ring.adapter.undertow.response :as response]
[taoensso.sente.interfaces :as i])
(:import
[io.undertow.websocke... | null | https://raw.githubusercontent.com/ptaoussanis/sente/798e50ee800cf3827c74fcd099d2b67ab13a28ee/src/taoensso/sente/server_adapters/community/undertow.clj | clojure | WebSocket
Adapter
Value returned in case of above timeout
(default `:undertow/ajax-resp-timeout`)" | (ns taoensso.sente.server-adapters.community.undertow
"Sente server adapter for ring-undertow-adapter."
{:author "Nik Peric"}
(:require
[ring.adapter.undertow.websocket :as websocket]
[ring.adapter.undertow.response :as response]
[taoensso.sente.interfaces :as i])
(:import
[io.undertow.websocke... |
8820a58bf6e4c1761077193c9eb2a77fe701fcddcd32e1f0393226b898ca5c9f | koto-bank/lbge | main.lisp | (defpackage :lbge-unit-tests
(:use
:cl :rove :lbge.utils
:lbge.rove-utils)
(:local-nicknames (:ax :alexandria))
(:export :run :collect-test-packages :run-on-travis-agent))
(in-package :lbge-unit-tests)
(defvar *current-file-path* "")
(defmacro define-test (name use-packages &body body)
(let ((actual-na... | null | https://raw.githubusercontent.com/koto-bank/lbge/6be4b3212ea87288b1ee2a655e9a1bb30a74dd27/a/unit-tests/main.lisp | lisp | (defpackage :lbge-unit-tests
(:use
:cl :rove :lbge.utils
:lbge.rove-utils)
(:local-nicknames (:ax :alexandria))
(:export :run :collect-test-packages :run-on-travis-agent))
(in-package :lbge-unit-tests)
(defvar *current-file-path* "")
(defmacro define-test (name use-packages &body body)
(let ((actual-na... | |
aad111c8abe7f00c95b06dce12cdee030eeb2a1ed8d28f37cdc107a4110fa255 | erszcz/learning | large_mq_worker.erl | -module(large_mq_worker).
-compile([export_all]).
-behaviour(gen_server).
%% API
-export([
start_link/0
]).
%% gen_server callbacks
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-define(SERVER, ?MODULE).
-re... | null | https://raw.githubusercontent.com/erszcz/learning/b21c58a09598e2aa5fa8a6909a80c81dc6be1601/erlang-large-message-queue/src/large_mq_worker.erl | erlang | API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
==============================================================... | -module(large_mq_worker).
-compile([export_all]).
-behaviour(gen_server).
-export([
start_link/0
]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-define(SERVER, ?MODULE).
-record(state, {blobs}).
grow_sta... |
fec854c2500c5742ae7d8d60215999737e07ffc6fd52fc1321f70574ccd04376 | saturn-lab/BDMI-2019S | SmallNumber.hs | doubleSmallNumber x = if x >100
then x
else x*2 | null | https://raw.githubusercontent.com/saturn-lab/BDMI-2019S/77f1e7a341a894f1c673e0f2340ccc37184c04b6/haskell/samples/SmallNumber.hs | haskell | doubleSmallNumber x = if x >100
then x
else x*2 | |
4fb163fdaf1f7df1eb53b81ae414f0f96703041272219558adcea21b5508b607 | inconvergent/cl-veq | mat.lisp |
(in-package :veq)
mat * v ; ( f3mtv mat x )
(defmacro make-mat-mv (dim type &optional transpose)
(awg (mm m v)
(let ((exportname (veqsymb dim type (if transpose "mtv" "mv"))))
(labels ((stp (i k) (if transpose (+ i (* k dim)) (+ (* i dim) k)))
(make-row-sum (i)
`(+ ,@(loop... | null | https://raw.githubusercontent.com/inconvergent/cl-veq/94e34f4c177b330fccf831b6f53d3e2f4e78c611/src/mat.lisp | lisp | ( f3mtv mat x )
eye(n) ; (f3eye n)
transpose inplace: (f3mt! mat)
mat * mat (f3mm mat mat) (f3mtm mat mat) etc
i tried to write these as macro-writing macros.
and i couldn't get it to work ...
make rot matrix
make rot matrix |
(in-package :veq)
(defmacro make-mat-mv (dim type &optional transpose)
(awg (mm m v)
(let ((exportname (veqsymb dim type (if transpose "mtv" "mv"))))
(labels ((stp (i k) (if transpose (+ i (* k dim)) (+ (* i dim) k)))
(make-row-sum (i)
`(+ ,@(loop for k from 0 below dim
... |
70dc3f2706fd91a80257392901f9e5701c407cc1eb70c0897d41e4c7b18c6afe | naoiwata/sicp | q2.81.scm | ;; @author naoiwata
SICP Chapter2
question 2.81
#|
(a)(b)
互いに異なる型であれば強制型変換を実行する処理ならば、互いが同じ型になった時点でその処理は停止する。しかし、既に同じ型を持っていても互いの型へ強制変換を強制してしまうと、処理が開始されてから互いに同じ型になったとしても再び処理が繰り返され、無限ループに陥ってしまう。
よって、同じ型でも強制型変換を実行する処理をすべきだというLouisの考えはapply-gereric処理が無限ループに陥ってしまうので、この主張は正しくない。
|#
; (c)
(define (apply-generic op . args... | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter2/q2.81.scm | scheme | @author naoiwata
(a)(b)
互いに異なる型であれば強制型変換を実行する処理ならば、互いが同じ型になった時点でその処理は停止する。しかし、既に同じ型を持っていても互いの型へ強制変換を強制してしまうと、処理が開始されてから互いに同じ型になったとしても再び処理が繰り返され、無限ループに陥ってしまう。
よって、同じ型でも強制型変換を実行する処理をすべきだというLouisの考えはapply-gereric処理が無限ループに陥ってしまうので、この主張は正しくない。
(c)
END | SICP Chapter2
question 2.81
(define (apply-generic op . args)
(let
((type-tags (map type-tag args)))
(let
((proc (get op type-tags)))
(if proc
(apply proc (map contents args))
(if (= (length args) 2)
(let ((type1 (car type-tags))
(type2... |
7acb61ccf6aae2589539bedc8c220480c67fd33642ea3c233dfb077e71d9f3c5 | mentat-collective/emmy | syntax.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.pattern.syntax
"The syntax namespace defines the default syntax for patterns corresponding to
the matcher combinators defined in [[emmy.pattern.match]]."
(:require [emmy.util :as u]))
# # # Notes
;;
;; The current version of the library declares the following synt... | null | https://raw.githubusercontent.com/mentat-collective/emmy/23248a9e8637b9b76636326b743656c0a6ed8abc/src/emmy/pattern/syntax.cljc | clojure |
The current version of the library declares the following syntax rules:
- `_` is a wildcard matcher that succeeds with anything and introduces no new
bindings.
- `?x` triggers an unrestricted binding match. It will match anything and
introduce a new binding from that symbol to the matched value.
- `(? <bi... | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.pattern.syntax
"The syntax namespace defines the default syntax for patterns corresponding to
the matcher combinators defined in [[emmy.pattern.match]]."
(:require [emmy.util :as u]))
# # # Notes
- ` ( $ $ < binding > ) ` or ` $ $ x ` will only match _ after _ t... |
d134255e21318b1e07c5c5b1ba8131c03e43b7eb98d0fd001f8e2c683481657b | graninas/Hydra | Catalogue.hs | module Astro.Catalogue where
import qualified Data.Time.Clock as Time
import qualified Hydra.Domain as D
import qualified Hydra.Language as L
import Hydra.Prelude
import qualified Database.Beam as B
import qualified Database.Beam.Sqlite as BS
import Database.Beam ((==.), (&&.))
import ... | null | https://raw.githubusercontent.com/graninas/Hydra/7ce16e705c2ce166f954dcca3910f258ae9b950c/app/astro/src/Astro/Catalogue.hs | haskell | TODO: Proper time handling
TODO: move into the framework. | module Astro.Catalogue where
import qualified Data.Time.Clock as Time
import qualified Hydra.Domain as D
import qualified Hydra.Language as L
import Hydra.Prelude
import qualified Database.Beam as B
import qualified Database.Beam.Sqlite as BS
import Database.Beam ((==.), (&&.))
import ... |
7ecd112a0af32205095dc6d7fe644e74937d2f805d5c629631f9ce987e081b74 | weblocks-framework/weblocks | runtime-class.lisp |
(in-package :weblocks)
(wexport '(make-class) '(t util))
(defun make-class (slots &optional (class-name (gensym)))
"Makes an anonymous class with a number of slots.
'slots' - a list of symbols to be used as slot names."
(ensure-class class-name
:direct-superclasses (list (find-class 'standard-obj... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/src/utils/runtime-class.lisp | lisp |
(in-package :weblocks)
(wexport '(make-class) '(t util))
(defun make-class (slots &optional (class-name (gensym)))
"Makes an anonymous class with a number of slots.
'slots' - a list of symbols to be used as slot names."
(ensure-class class-name
:direct-superclasses (list (find-class 'standard-obj... | |
2463201282ce62074a74521fcffa565b620334c1c3d1666396cc48137b819352 | hopv/MoCHi | CEGAR.ml | open Util
open Mochi_util
open CEGAR_syntax
open CEGAR_type
open CEGAR_util
module MC = ModelCheck
module Debug = Debug.Make(struct let check = Flag.Debug.make_check __MODULE__ end)
type result =
| Safe of (var * CEGAR_ref_type.t) list
| Unsafe of int list * MC.counterexample
| Unknown of string
let pre () =
... | null | https://raw.githubusercontent.com/hopv/MoCHi/b0ac0d626d64b1e3c779d8e98cb232121cc3196a/src/CEGAR.ml | ocaml | termination analysis | open Util
open Mochi_util
open CEGAR_syntax
open CEGAR_type
open CEGAR_util
module MC = ModelCheck
module Debug = Debug.Make(struct let check = Flag.Debug.make_check __MODULE__ end)
type result =
| Safe of (var * CEGAR_ref_type.t) list
| Unsafe of int list * MC.counterexample
| Unknown of string
let pre () =
... |
0e6b1810032a5dc0ebc7b6677e3a102baa0b0f56b17dc8aa9285a53e0211db0d | facebook/infer | Sil.ml |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... | null | https://raw.githubusercontent.com/facebook/infer/478e309dc9d0059e671ccc98c63e7ab9c53abd49/infer/src/IR/Sil.ml | ocaml | * Shorthands to carry expression maps through chained structural equalities below
assume e and e' equal, enforce by adding to [exp_map]
ignore [try_id] of exception-handling metadata nodes, just checking for structural equality |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... |
166bc7c9238b0234e5512404f23fa43db0c2ca7c5b167d2c128288764ba0476c | billstclair/trubanc-lisp | util.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : HUNCHENTOOT ; Base : 10 -*-
$ Header : /usr / local / cvsrep / hunchentoot / util.lisp , v 1.35 2008/04/08 14:39:18 edi Exp $
Copyright ( c ) 2004 - 2009 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;;... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/hunchentoot-1.0.0/util.lisp | lisp | Syntax : COMMON - LISP ; Package : HUNCHENTOOT ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and t... | $ Header : /usr / local / cvsrep / hunchentoot / util.lisp , v 1.35 2008/04/08 14:39:18 edi Exp $
Copyright ( c ) 2004 - 2009 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :... |
7e86f072d84d701122fd671bc7dbedeb3a6f25e7c9e8b04304021865d1325558 | erlang/rebar3 | rebar_paths.erl | -module(rebar_paths).
-include("rebar.hrl").
-type target() :: deps | plugins | runtime.
-type targets() :: [target(), ...].
-export_type([target/0, targets/0]).
-export([set_paths/2, unset_paths/2]).
-export([clashing_apps/2]).
-ifdef(TEST).
-export([misloaded_modules/2]).
-endif.
-spec set_paths(targets(), rebar_s... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/src/rebar_paths.erl | erlang |
PRIVATE %%%
The paths are to be set in the reverse order; i.e. the default
path is always last when possible (minimize cases where a build
tool version clashes with an app's), and put the highest priorities
first.
Plan for the eventuality of getting values piped in
from future versions of rebar3, possibly from... | -module(rebar_paths).
-include("rebar.hrl").
-type target() :: deps | plugins | runtime.
-type targets() :: [target(), ...].
-export_type([target/0, targets/0]).
-export([set_paths/2, unset_paths/2]).
-export([clashing_apps/2]).
-ifdef(TEST).
-export([misloaded_modules/2]).
-endif.
-spec set_paths(targets(), rebar_s... |
1af98e48b668c900de46f961adea9c5024950893af354f5a448a9b14a5ab6928 | ghc/testsuite | tcfail053.hs | module TcFail where
data B = C A
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/tcfail053.hs | haskell | module TcFail where
data B = C A
| |
fd5ee2ae38f3e2622534ddb78c9a8edd0dd272b3ca6eac1d61b333b0fd26a640 | shirok/Gauche | regexp.scm | ;;;
;;; regexp.scm - auxiliary macros and procedures for regexp. autoloaded.
;;;
Copyright ( c ) 2000 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions o... | null | https://raw.githubusercontent.com/shirok/Gauche/1b2e57ebf1e875a2a61284a5601341cee4742ef8/lib/gauche/regexp.scm | scheme |
regexp.scm - auxiliary macros and procedures for regexp. autoloaded.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list ... | Copyright ( c ) 2000 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
NB : refrain from using util.match , for i... |
95a973e6b0a2d36d58f58122ffa64aa8f00c7957c3b6ad87d09b3fc8d8f39864 | macintux/lynch | hs.erl | @author < >
( C ) 2013 ,
%%% @doc
Implement the Hirschberg and Sinclair algorithm for leader
election as described in Lynch section 3.4 .
%%% @end
Created : 10 Nov 2013 by < >
-module(hs).
-include("process.hrl").
-behavior(process).
-export([init/3, step/2, handle_message/4, dump/1, complexity... | null | https://raw.githubusercontent.com/macintux/lynch/63ed74634872b23a4bcce6315cd1077817a4ad56/sync/HS/hs.erl | erlang | @doc
@end
Last branch in algorithm
Drop the message. This is not explicit in the book's detailed algorithm | @author < >
( C ) 2013 ,
Implement the Hirschberg and Sinclair algorithm for leader
election as described in Lynch section 3.4 .
Created : 10 Nov 2013 by < >
-module(hs).
-include("process.hrl").
-behavior(process).
-export([init/3, step/2, handle_message/4, dump/1, complexity/2]).
-record(sta... |
dec5c45e9e4fa1704610f10a07e39c4b5b9e464810322623304ce00ac67bfc28 | typelead/intellij-eta | Quote00001.hs | module Quote00001 where
f = map (`Declaration` Nothing)
| null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/test/resources/fixtures/eta/sources/Quote00001.hs | haskell | module Quote00001 where
f = map (`Declaration` Nothing)
| |
aa077f7a026abbc9fef5fadc4e6da0cd280b726ba9cf559f45aa22c37d467d96 | MondayMorningHaskell/Monads | Transformers.hs | module Transformers where
import Control.Monad.IO.Class
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Reader
import Control.Monad.Trans.Maybe
import Data.Char (isUpper, isLower)
main1 :: IO ()
main1 = do
maybeUserName <- readUserName
case maybeUserName of
Nothing -> print "Invalid user na... | null | https://raw.githubusercontent.com/MondayMorningHaskell/Monads/41bda26e0199c1c0734bd2c8c45f33b880ac3122/src/Transformers.hs | haskell | MaybeT Reference
newtype MaybeT m a = MaybeT { runMaybeT :: m (Maybe a) }
instance (Monad m) => Monad (MaybeT m) where
return = lift . return
x >>= f = MaybeT $ do
v <- runMaybeT x
case v of
Nothing -> return Nothing
Just y -> runMaybeT (f y)
TODO: Fill in these functions to work with "Ma... | module Transformers where
import Control.Monad.IO.Class
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Reader
import Control.Monad.Trans.Maybe
import Data.Char (isUpper, isLower)
main1 :: IO ()
main1 = do
maybeUserName <- readUserName
case maybeUserName of
Nothing -> print "Invalid user na... |
2bf34e2fd663a3f1bef83f2b63685cf9bb76b6f15fe10846780f279e29ab2748 | emqx/emqx | emqx_bridge_api.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/a81d1a46181b8d5fddba371108047457ec64a5e5/apps/emqx_bridge/src/emqx_bridge_api.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 ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_bridge_api).
-behaviour(minirest_api).
-include_lib("typerefl/include/types.hrl").... |
c4f96218a533b4e78bd9ae3c25316461a7535719aecb1f8dce4629f10a56c050 | brendanhay/gogol | Get.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-resourcemanager/gen/Gogol/ResourceManager/Cloudresourcemanager/Operations/Get.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
/See:/ <-manager Cloud Resource Manager API Reference> for @cloudresourc... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
59a50341ad2f5cd2c9a190845e27e0a4fb868abf165b8978c6ce677c9963364e | janestreet/ocaml_plugin | plugin_001.ml | open! Core
(* example of plugin of type Plugin_intf.S *)
let side_effect = print_endline "plugin_001.ml is being executed !"
let message = "This is plugin_001's message"
| null | https://raw.githubusercontent.com/janestreet/ocaml_plugin/7edff57f62e1d0039719f8f29c3e9d0aa85568a2/hello_world/bin/plugin_001.ml | ocaml | example of plugin of type Plugin_intf.S | open! Core
let side_effect = print_endline "plugin_001.ml is being executed !"
let message = "This is plugin_001's message"
|
1447aa2e13a7fe2cb36ddfef4a468708027cb8ff68172543144e527c05d5af36 | bragful/ephp | ephp_parser_test.erl | -module(ephp_parser_test).
-author('').
-compile([warnings_as_errors]).
-include_lib("eunit/include/eunit.hrl").
-include("ephp.hrl").
-define(PARSE, ephp_parser:parse).
only_text_test_() ->
[?_assertMatch([#print_text{text = <<"<html><body><h1>Hi world!</h1></body></html>">>}],
?PARSE("<ht... | null | https://raw.githubusercontent.com/bragful/ephp/119f1760a5cdf4c8b6a01739e852c7183af7acff/test/ephp_parser_test.erl | erlang | -module(ephp_parser_test).
-author('').
-compile([warnings_as_errors]).
-include_lib("eunit/include/eunit.hrl").
-include("ephp.hrl").
-define(PARSE, ephp_parser:parse).
only_text_test_() ->
[?_assertMatch([#print_text{text = <<"<html><body><h1>Hi world!</h1></body></html>">>}],
?PARSE("<ht... | |
5be177603ab6dd09472e1fa2804eb5c09e71e94b86a65585d17403a75c3c5528 | haskell/parsec | Bugs.hs |
module Bugs
( bugs
) where
import Test.Tasty
import qualified Bugs.Bug2
import qualified Bugs.Bug6
import qualified Bugs.Bug9
import qualified Bugs.Bug35
bugs :: [TestTree]
bugs = [ Bugs.Bug2.main
, Bugs.Bug6.main
, Bugs.Bug9.main
, Bugs.Bug35.main
]
| null | https://raw.githubusercontent.com/haskell/parsec/9a1f72c1c77e3bb9ac2a3ca9b0aedd66f3c7f356/test/Bugs.hs | haskell |
module Bugs
( bugs
) where
import Test.Tasty
import qualified Bugs.Bug2
import qualified Bugs.Bug6
import qualified Bugs.Bug9
import qualified Bugs.Bug35
bugs :: [TestTree]
bugs = [ Bugs.Bug2.main
, Bugs.Bug6.main
, Bugs.Bug9.main
, Bugs.Bug35.main
]
| |
c35ddee1bb0e1e29248cc3cd13f3d851642e11d21f00e1f79ec6903c929b121d | Gbury/archsat | dedukti.ml | This file is free software , part of Archsat . See file " LICENSE " for more details .
let section = Section.make "dedukti"
let formula a = a.Dispatcher.SolverTypes.lit
(* Printing wrappers *)
(* ************************************************************************ *)
module Print = struct
let pos = Tag.cre... | null | https://raw.githubusercontent.com/Gbury/archsat/322fbefa4a58023ddafb3fa1a51f8199c25cde3d/src/proof/dedukti.ml | ocaml | Printing wrappers
************************************************************************
TODO: change this code as soone as official syntax description is available.
Application
Let-binding
Other binders
Printing contexts
************************************************************************ | This file is free software , part of Archsat . See file " LICENSE " for more details .
let section = Section.make "dedukti"
let formula a = a.Dispatcher.SolverTypes.lit
module Print = struct
let pos = Tag.create ()
let name = Tag.create ()
let assoc = Tag.create ()
let variant = Tag.create ()
type any ... |
889ecd0abb2752a07da496f1f383e4f7d8780b2a5a999835847de8d43be908e8 | wdebeaum/DeepSemLex | wheat.lisp | ;;;;
W::WHEAT
;;;;
(define-words :pos W::n
:words (
(W::WHEAT
(senses
((LF-PARENT ONT::GRAINS)
(TEMPL MASS-PRED-TEMPL)
(syntax (W::morph (:forms (-none))))
)
)
)
))
(define-words :pos W::n
:words (
((W::WHEAT W::GERM)
(senses
((LF-PARENT ONT::FOOD-GRAINS)
(TEMPL MASS-PRED-T... | null | https://raw.githubusercontent.com/wdebeaum/DeepSemLex/ce0e7523dd2b1ebd42b9e88ffbcfdb0fd339aaee/trips/src/LexiconManager/Data/new/wheat.lisp | lisp | W::WHEAT
(define-words :pos W::n
:words (
(W::WHEAT
(senses
((LF-PARENT ONT::GRAINS)
(TEMPL MASS-PRED-TEMPL)
(syntax (W::morph (:forms (-none))))
)
)
)
))
(define-words :pos W::n
:words (
((W::WHEAT W::GERM)
(senses
((LF-PARENT ONT::FOOD-GRAINS)
(TEMPL MASS-PRED-TEMPL)
... | |
196afd41052ac6394bca2bea44c0892ab49cdc3dc8d8b1e08b85bd4f759fb758 | TrustInSoft/tis-kernel | marks.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/pdg/marks.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
c729927cffcc354692fb1bc10f489b4f8f46da5833df67c0bf4b09b288cd316a | aryx/xix | sysnop.ml | open Common
let syscall_nop () =
print "Hello World!\n"
| null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/kernel/sysnop.ml | ocaml | open Common
let syscall_nop () =
print "Hello World!\n"
| |
b6975f5ae998db6205ce7fa2c697259182513452d3d7adb54733549d3d13f7e5 | city41/mario-review | export_view.cljs | (ns daisy.client.components.export-view
(:require [om.core :as om :include-macros true]
[cljs.core.async :refer [put!]]
[sablono.core :as html :refer-macros [html]]))
(def data-url-header "data:image/png;base64,")
(defn create-canvas [w h]
(let [canvas (.createElement js/document "canvas")... | null | https://raw.githubusercontent.com/city41/mario-review/1b6ebfff88ad778a52865a062204cabb8deed0f9/cropping-app/src/client/export_view.cljs | clojure | (ns daisy.client.components.export-view
(:require [om.core :as om :include-macros true]
[cljs.core.async :refer [put!]]
[sablono.core :as html :refer-macros [html]]))
(def data-url-header "data:image/png;base64,")
(defn create-canvas [w h]
(let [canvas (.createElement js/document "canvas")... | |
cced7b4fac7709a8ddcc33cb49d87da0431705b18e791d1cf34091e08db92616 | LexiFi/csml | gen_csml_iface.ml | This file is released under the terms of an MIT - like license .
(* See the attached LICENSE file. *)
Copyright 2016 by LexiFi .
open Pp
open Pp.Operators
open Misc
let cb l = ~~"{@[\n %t@]\n }\n " (all l)
let d f x = f x x
let d4 f... | null | https://raw.githubusercontent.com/LexiFi/csml/1bdffc60b937b0cd23730589b191940cd1861640/src/gen_csml_iface.ml | ocaml | See the attached LICENSE file. | This file is released under the terms of an MIT - like license .
Copyright 2016 by LexiFi .
open Pp
open Pp.Operators
open Misc
let cb l = ~~"{@[\n %t@]\n }\n " (all l)
let d f x = f x x
let d4 f x = f x x x x
let comma f = seq ~sep:~~", " f 0
let typs = comma ~~"T... |
994f3f1b385be4b6f6c4b357d244767d40908aa18830033f70ca7462103642ed | janestreet/base | nativeint.ml | open! Import
open! Stdlib.Nativeint
include Nativeint_replace_polymorphic_compare
module T = struct
type t = nativeint [@@deriving_inline globalize, hash, sexp, sexp_grammar]
let (globalize : (t[@ocaml.local]) -> t) =
(globalize_nativeint : (t[@ocaml.local]) -> t)
;;
let (hash_fold_t : Ppx_hash_lib.Std.H... | null | https://raw.githubusercontent.com/janestreet/base/1462b7d5458e96569275a1c673df968ecbf3342f/src/nativeint.ml | ocaml | Open replace_polymorphic_compare after including functor instantiations so they do not
shadow its definitions. This is here so that efficient versions of the comparison
functions are available within this module.
* Hacker's Delight Second Edition p106
* Hacker's Delight Second Edition p106
Include type-speci... | open! Import
open! Stdlib.Nativeint
include Nativeint_replace_polymorphic_compare
module T = struct
type t = nativeint [@@deriving_inline globalize, hash, sexp, sexp_grammar]
let (globalize : (t[@ocaml.local]) -> t) =
(globalize_nativeint : (t[@ocaml.local]) -> t)
;;
let (hash_fold_t : Ppx_hash_lib.Std.H... |
1e2c9084f2b52b83ca81dcba33f785839b6115eb06e48032c96e07b53b04d65e | eponai/sulolive | diff.cljc | (ns eponai.common.diff
(:require [clojure.data :as data]
[clojure.set :as set]))
(declare recursive-diff-merge)
(defn diff [a b]
(data/diff a b))
(defn undiff
"returns the state of x after reversing the changes described by a diff against
an earlier state (where before and after are the first tw... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/common/diff.cljc | clojure | Giving other names to diff and undiff, making it easier to think about.
Also places the 'to' parameter in the same position.
Inspiration from: #example-56c7039fe4b0b41f39d96cce
To invert a diff you can re-apply diff to its output and then merge this back with the prior state
This works in almost all cases (with ... | (ns eponai.common.diff
(:require [clojure.data :as data]
[clojure.set :as set]))
(declare recursive-diff-merge)
(defn diff [a b]
(data/diff a b))
(defn undiff
"returns the state of x after reversing the changes described by a diff against
an earlier state (where before and after are the first tw... |
523b95a739a4bc7935ca6a813456b3c903ef3d35e6ea842cadfb5d6164b11b54 | yesodweb/yesod | NoOverloadedStringsSub.hs | # LANGUAGE QuasiQuotes , TypeFamilies , TemplateHaskell , MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ViewPatterns #
{-# LANGUAGE OverloadedStrings #-} -- hah, the test should be renamed...
-- Not actually a problem, we're now requiring overloaded strings, we just need
... | null | https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/yesod-core/test/YesodCoreTest/NoOverloadedStringsSub.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
hah, the test should be renamed...
Not actually a problem, we're now requiring overloaded strings, we just need
to make the docs more explicit about it. | # LANGUAGE QuasiQuotes , TypeFamilies , TemplateHaskell , MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE ViewPatterns #
module YesodCoreTest.NoOverloadedStringsSub where
import Yesod.Core
import Yesod.Core.Types
data Subsite = Subsite (forall master. Yesod master => YesodSubRunnerEnv Subsite master... |
da5d56cd6f3ea796e06ca6bc025622e5804cd376d0786279f332029d31cca3c3 | agda/agda | Builtin.hs |
module Agda.TypeChecking.Monad.Builtin
( module Agda.TypeChecking.Monad.Builtin
, module Agda.Syntax.Builtin -- The names are defined here.
) where
import qualified Control.Monad.Fail as Fail
import Control.Monad ( liftM2, void )
import Control.Monad.Except
import Control.Monad.IO.Class (... | null | https://raw.githubusercontent.com/agda/agda/1c4731fb8dbc85d2482aa0b32c6dfa7aa9e37bcb/src/full/Agda/TypeChecking/Monad/Builtin.hs | haskell | The names are defined here.
LEADS TO IMPORT CYCLE
| Get the currently registered rewrite relation symbols.
| @getTerm use name@ looks up @name@ as a primitive or builtin, and
throws an error otherwise.
The @use@ argument describes how the name is used for the sake of
the error message.
| Rewrite a literal to co... |
module Agda.TypeChecking.Monad.Builtin
( module Agda.TypeChecking.Monad.Builtin
) where
import qualified Control.Monad.Fail as Fail
import Control.Monad ( liftM2, void )
import Control.Monad.Except
import Control.Monad.IO.Class ( MonadIO(..) )
import Control.Monad.Reader
import Control.Monad... |
870d05e39f7b9145dfb3febfd799700f158c518e5af0bb87e2fdb321f607a6c7 | MinaProtocol/mina | util.mli | val absorb :
'a 'g1 'g1_opt 'f 'scalar.
absorb_field:('f -> unit)
-> absorb_scalar:('scalar -> unit)
-> g1_to_field_elements:('g1 -> 'f list)
-> mask_g1_opt:('g1_opt -> 'g1)
-> ( 'a
, < base_field : 'f ; g1 : 'g1 ; g1_opt : 'g1_opt ; scalar : 'scalar > )
Type.t
-> 'a
-> unit
val ones_vecto... | null | https://raw.githubusercontent.com/MinaProtocol/mina/b19a220d87caa129ed5dcffc94f89204ae874661/src/lib/pickles/util.mli | ocaml | val absorb :
'a 'g1 'g1_opt 'f 'scalar.
absorb_field:('f -> unit)
-> absorb_scalar:('scalar -> unit)
-> g1_to_field_elements:('g1 -> 'f list)
-> mask_g1_opt:('g1_opt -> 'g1)
-> ( 'a
, < base_field : 'f ; g1 : 'g1 ; g1_opt : 'g1_opt ; scalar : 'scalar > )
Type.t
-> 'a
-> unit
val ones_vecto... | |
b55c727273bcd52bffafe630bc9500e815bc953903d9145475681f63f4d277c7 | TheLortex/mirage-monorepo | ppxlib.ml | (** Standard library for ppx rewriters *)
* Make sure code using Ppxlib does n't refer to compiler - libs without being
explicit about it
explicit about it *)
include struct
[@@@warning "-3"]
open Ocaml_shadow
include (
Ocaml_shadow :
module type of struct
include Ocaml_shadow
... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/ppxlib/src/ppxlib.ml | ocaml | * Standard library for ppx rewriters
* Expose some modules from Ppxlib_ast; in particular, overwrite some of the
modules above
* Include all the Ast definitions since we need them in every single ppx
*/*
For tests and Ppx_core compatibility layer |
* Make sure code using Ppxlib does n't refer to compiler - libs without being
explicit about it
explicit about it *)
include struct
[@@@warning "-3"]
open Ocaml_shadow
include (
Ocaml_shadow :
module type of struct
include Ocaml_shadow
end
with module Ast_helper := Ast_h... |
1c8c13622c7295b972f26ffdcf9b8f9bf05215ebd73ab5bf457296f05904e15e | aryx/xix | string.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/lib_core/strings/string.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
$ I d : string.ml , v 1.13 1997/12/09 09:12:05 xleroy Exp $
external length : string -> int = "%string_lengt... |
e61b8a5e05f766d611ae626e7869392ed50825f3eb88cf3b2333dab9f97a5749 | bobbae/gosling-emacs | dabbrevs.ml | ; DABBREVS - "Dynamic abbreviations" hack, originally written by Don Morrison
; for Twenex Emacs. Converted to mlisp by Russ Fish. Supports the table
; feature to avoid hitting the same expansion on re-expand, and the search
; size limit variable. Bugs fixed from the Twenex version are flagged by
; comments starting... | null | https://raw.githubusercontent.com/bobbae/gosling-emacs/8fdda532abbffb0c952251a0b5a4857e0f27495a/maclib/dabbrevs.ml | ocaml | ; DABBREVS - "Dynamic abbreviations" hack, originally written by Don Morrison
; for Twenex Emacs. Converted to mlisp by Russ Fish. Supports the table
; feature to avoid hitting the same expansion on re-expand, and the search
; size limit variable. Bugs fixed from the Twenex version are flagged by
; comments starting... | |
9d53aced5c00fb67a9a70e8abc4ea9a7da7c2344cc8bf98110d4d620cbbd052d | robert-strandh/Second-Climacs | wad-descriptor.lisp | (cl:in-package #:second-climacs-syntax-common-lisp)
;;;; A wad descriptor is a object that facilitates the manipulation of
;;;; a hierarchy of wads, because it contains absolute positions of
;;;; the start and end of the wad, and it contains references to the
;;;; parent, the children, and the siblings of a wad. Of c... | null | https://raw.githubusercontent.com/robert-strandh/Second-Climacs/fa37ffa1702fcb6c0b538add3eaa1551f45d000d/Code/Syntax/Common-Lisp/wad-descriptor.lisp | lisp | A wad descriptor is a object that facilitates the manipulation of
a hierarchy of wads, because it contains absolute positions of
the start and end of the wad, and it contains references to the
parent, the children, and the siblings of a wad. Of course, a
wad descriptor doesn't stay valid for very long. As soon a... | (cl:in-package #:second-climacs-syntax-common-lisp)
(defclass wad-descriptor ()
(%wad
:initarg :wad
:reader wad)
(%start-line-number
:initarg :start-line-number
:reader start-line-number)
(%start-column-number
:initarg :start-column-number
:reader start-column-number)
(%end-line-nu... |
43d29b7b1eb665eb079e520876aa4bebc7f6d0989dd0317c22e5da40dcf04e07 | mrnugget/scheme_x86 | scratch.scm | (load "src/compiler.scm")
(define in '(letrec ([f 12] [g 13]) (prim-apply + f g)))
(pretty-print (let* ([bindings (let-bindings in)]
[new-bindings (map (lambda (b) `(,(car b) #f)) bindings)]
[inits (map (lambda (b) `(set! ,(car b) ,(cadr b))) bindings)])
`(let ,new-bindings ,@inits ,@(let-body in))))
| null | https://raw.githubusercontent.com/mrnugget/scheme_x86/2a02cde1e482bc4be73ad460c97d643a4ea0e2e0/scratch.scm | scheme | (load "src/compiler.scm")
(define in '(letrec ([f 12] [g 13]) (prim-apply + f g)))
(pretty-print (let* ([bindings (let-bindings in)]
[new-bindings (map (lambda (b) `(,(car b) #f)) bindings)]
[inits (map (lambda (b) `(set! ,(car b) ,(cadr b))) bindings)])
`(let ,new-bindings ,@inits ,@(let-body in))))
| |
9fba8bf8eeb7b3cfc22cd2f7fe67e125999269513ece3c1f070d0e664bfabd2e | racket/parser-tools | info.rkt | #lang info
(define collection 'multi)
(define deps '("base"))
(define build-deps '("scheme-lib"
"racket-doc"
"syntax-color-doc"
"parser-tools-lib"
"scribble-lib"))
(define update-implies '("parser-tools-lib"))
(define pkg-desc "docume... | null | https://raw.githubusercontent.com/racket/parser-tools/4afd434f2fcd719132e7a5b2c263faf544f916ca/parser-tools-doc/info.rkt | racket | #lang info
(define collection 'multi)
(define deps '("base"))
(define build-deps '("scheme-lib"
"racket-doc"
"syntax-color-doc"
"parser-tools-lib"
"scribble-lib"))
(define update-implies '("parser-tools-lib"))
(define pkg-desc "docume... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.