_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 |
|---|---|---|---|---|---|---|---|---|
59e2cb063094de708e509b29260f7adde86f7c789f9d1f734e70c0a6c41f7119 | ghcjs/ghcjs-dom | Attr.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.Attr
(js_getNamespaceURI, getNamespaceURI, getNamespaceURIUnsafe,
getNamespaceU... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/Attr.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/Attr.specified Mozilla Attr.specified documentation> | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.Attr
(js_getNamespaceURI, getNamespaceURI, getNamespaceURIUnsafe,
getNamespaceURIUnchecked, js_getPrefix, getPrefix, getPrefixUnsafe,
getPrefixUnchecked, js_getLocalName,... |
83347f4c61b6e3ff2fbeda75947dd68e0951fbab4e6921ea03352363370db7e2 | SamB/coq | decls.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/library/decls.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* This module registers tables for s... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ Id$
open Names
open T... |
2984fd24d95f93d296918b2d4493b62b2863d538dec92780a8e9f330e54a2bc3 | haskell-suite/haskell-src-exts | EmptyCase.hs | # LANGUAGE EmptyCase #
# LANGUAGE LambdaCase #
f x = case x of {}
g x = \case {}
| null | https://raw.githubusercontent.com/haskell-suite/haskell-src-exts/84a4930e0e5c051b7d9efd20ef7c822d5fc1c33b/tests/examples/EmptyCase.hs | haskell | # LANGUAGE EmptyCase #
# LANGUAGE LambdaCase #
f x = case x of {}
g x = \case {}
| |
146574182069ef5d7cce7d614996a002027ffe69fa32cee3247109018978267c | leviroth/ocaml-reddit-api | karma_list.mli | open! Core
module Entry : sig
type t [@@deriving sexp, jsonaf]
val subreddit : t -> Subreddit_name.t
val link_karma : t -> int
val comment_karma : t -> int
end
type t = Entry.t list [@@deriving sexp]
include Json_object.S_with_kind with type t := t
| null | https://raw.githubusercontent.com/leviroth/ocaml-reddit-api/6519697a39d68d675c3c36fd54add8ba35e939f3/reddit_api_kernel/karma_list.mli | ocaml | open! Core
module Entry : sig
type t [@@deriving sexp, jsonaf]
val subreddit : t -> Subreddit_name.t
val link_karma : t -> int
val comment_karma : t -> int
end
type t = Entry.t list [@@deriving sexp]
include Json_object.S_with_kind with type t := t
| |
979d93f367e64cd52cbfd5612ff44d87f3911d569c8dfb0c8b7f893e0672cae9 | Kappa-Dev/KappaTools | mods.mli | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/dataStructures/mods.mli | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
* ' functors instantiation
val int_compare : int -> int -> int
val int_pair_compare : (int*int) -> (int*int) -> int
val pair_equal :
('a -> 'a -> bool) -> ('b -> 'b -> bool) -> 'a * 'b -> 'a * 'b -> bool
module StringSetMap : SetMap.... |
6fe657b84b1b4036aa4f3ead65ff9b72fe63f48e9940c3217914a0c59d0d24f3 | iokasimov/pandora | Bindable.hs | module Pandora.Pattern.Functor.Bindable where
import Pandora.Pattern.Functor.Covariant (Covariant)
infixr 1 =======<<
infixr 2 ======<<
infixr 3 =====<<
infixr 4 ====<<
infixr 5 ===<<
infixr 6 ==<<
infixr 7 =<<
{- |
> When providing a new instance, you should ensure it satisfies :
> * Interchange: t >>= f = join (f ... | null | https://raw.githubusercontent.com/iokasimov/pandora/578ec3b831aaad201e1d32eed72f4ca7229b4bea/Pandora/Pattern/Functor/Bindable.hs | haskell | |
> When providing a new instance, you should ensure it satisfies :
> * Interchange: t >>= f = join (f <-|- t)
| module Pandora.Pattern.Functor.Bindable where
import Pandora.Pattern.Functor.Covariant (Covariant)
infixr 1 =======<<
infixr 2 ======<<
infixr 3 =====<<
infixr 4 ====<<
infixr 5 ===<<
infixr 6 ==<<
infixr 7 =<<
class Covariant source source t => Bindable source t where
(=<<) :: source a (t b) -> source (t a) (t b)... |
ca46d4f5c020f3379e85859581a21aea1cf19e134c4b78d1d82407935516e076 | clash-lang/clash-prelude | Unsigned.hs | |
Copyright : ( C ) 2013 - 2016 , University of Twente ,
2016 , Myrtle Software Ltd
License : BSD2 ( see the file LICENSE )
Maintainer : < >
Copyright : (C) 2013-2016, University of Twente,
2016 , Myrtle Software Ltd
License : BSD2 (see the fil... | null | https://raw.githubusercontent.com/clash-lang/clash-prelude/5645d8417ab495696cf4e0293796133c7fe2a9a7/src/Clash/Sized/Internal/Unsigned.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE MagicHash #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# OPTIONS_HADDOCK show-extensions not-ho... | |
Copyright : ( C ) 2013 - 2016 , University of Twente ,
2016 , Myrtle Software Ltd
License : BSD2 ( see the file LICENSE )
Maintainer : < >
Copyright : (C) 2013-2016, University of Twente,
2016 , Myrtle Software Ltd
License : BSD2 (see the fil... |
1a3eb837d2a54afe9d979c0d500ae208466cf6a95f5ce5633888768c9ac91d50 | rpav/ninja-sphere | tilemap.lisp | (in-package :ninja-sphere)
(defparameter *tileset-cache* (make-hash-table :test 'equal))
TILE , TILESET
(defclass tileset ()
((props :initform nil :accessor props)
(name :initform nil :initarg :name :reader tileset-name)
(count :initform nil :initarg :count :reader tileset-count)
(tile-names :initform n... | null | https://raw.githubusercontent.com/rpav/ninja-sphere/f6708d9ab209a831c7e7df3f12d32ecc4afe0426/src/tilemap.lisp | lisp | TILE-MERGESET
TILEMAP
GK-TILEMAP
This could in theory be done slightly more ideally, but at great
inconvenience. | (in-package :ninja-sphere)
(defparameter *tileset-cache* (make-hash-table :test 'equal))
TILE , TILESET
(defclass tileset ()
((props :initform nil :accessor props)
(name :initform nil :initarg :name :reader tileset-name)
(count :initform nil :initarg :count :reader tileset-count)
(tile-names :initform n... |
51d31b10d5563880f43f617811d07bc26e003f8a23a8c2877bafb6df33ca250a | SKA-ScienceDataProcessor/RC | ddp-erlang-style.hs | -- |Distributed Dot Product - Erlang Style
--
-- Backend implementation for DNA project.
Author : Braam Research , LLC
Copyright ( C ) 2014 Cambridge University
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAG... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS1/ddp-erlang-style/ddp-erlang-style.hs | haskell | |Distributed Dot Product - Erlang Style
Backend implementation for DNA project.
# LANGUAGE TemplateHaskell #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveGeneric #
Collects data from compute processes, looking for either partial sum result or monitoring messages.
Partial sums are get accumulated.
XXX The s... | Author : Braam Research , LLC
Copyright ( C ) 2014 Cambridge University
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ForeignFunctionInterface #
module Main where
import GHC.Generics (Generic)
import Data.Typeable
import Control.DeepSeq
import Control.Monad
import System.Posix.Files
import System.Environm... |
a415d0a457afc094c6b0cf2960a3696ad071f9b6f0187e33a5b58d05b124daef | uwplse/rake | synthesizer.rkt | #lang rosette/safe
(require
(only-in racket/base exit values for make-hash hash-set! hash-has-key?)
rosette/lib/destruct
rosette/lib/synthax
rake/internal/log
rake/halide
rake/hvx/ast/types
rake/hvx/interpreter
rake/synthesis/lowering/util)
(provide synthesize-translation lowering:synthesizer:reset-db... | null | https://raw.githubusercontent.com/uwplse/rake/0fb9b46ae8ac64f95a4c0e89060ffdb043229a5b/rake/synthesis/lowering/synthesizer.rkt | racket | (pretty-print halide-expr)
(pretty-print template)
(pretty-print translation-history)
(pretty-print optimized-halide-expr)
(pretty-print optimized-template)
Incrementally checks the template for more and more lanes
(display (format "Verifying lane: ~a\n" curr-lane))
(println inferred-axioms)
(println ((... | #lang rosette/safe
(require
(only-in racket/base exit values for make-hash hash-set! hash-has-key?)
rosette/lib/destruct
rosette/lib/synthax
rake/internal/log
rake/halide
rake/hvx/ast/types
rake/hvx/interpreter
rake/synthesis/lowering/util)
(provide synthesize-translation lowering:synthesizer:reset-db... |
c459b1489dd628165d4b89c0cd2ed21fa058ec5fdfbb76ca65b643ed6ae70012 | byteally/dbrecord | Parser.hs | {-# LANGUAGE OverloadedStrings #-}
module DBRecord.MySQL.Internal.Sql.Parser where
( sqlExpr
, parseMySQLType
, SizeInfo ( .. )
, defSizeInfo
) where
import DBRecord . Internal . . DML
import qualified Data . Text as T
import Control . Applicative
import Data . Attoparsec . Text hiding ( ... | null | https://raw.githubusercontent.com/byteally/dbrecord/991efe9a293532ee9242b3e9a26434cf16f5b2a0/dbrecord-mysql-haskell/src/DBRecord/MySQL/Internal/Sql/Parser.hs | haskell | # LANGUAGE OverloadedStrings #
compositeExpr < | >
< *
endOfInput
aggrFunSqlExpr < | >
ParamSqlExpr
ExistsSqlExpr
TODO : Assuming columns are of " foo" . "bar < op > baz ... "
TODO : Identify prefix operators
TODO : Identify postfix operators ... | module DBRecord.MySQL.Internal.Sql.Parser where
( sqlExpr
, parseMySQLType
, SizeInfo ( .. )
, defSizeInfo
) where
import DBRecord . Internal . . DML
import qualified Data . Text as T
import Control . Applicative
import Data . Attoparsec . Text hiding ( number )
import Data . Text ( Tex... |
39a133016a54bcbc73e385717727703ee25f3ebf447d2934ff69908d33038dc4 | ranjitjhala/haddock-annot | Make.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Make
Copyright : Martin Sjögren 2004
--
-- Maintainer :
-- Portability : portable
--
This is an alternative build system that delegates everything to the @make@
program . All the command... | null | https://raw.githubusercontent.com/ranjitjhala/haddock-annot/ffaa182b17c3047887ff43dbe358c246011903f6/Cabal-1.10.1.1/Distribution/Make.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Make
Maintainer :
Portability : portable
arguments. The intention was to allow preexisting packages that used
such packages were converted over to the \"Simple\" build system instead.
Consequently this... | Copyright : Martin Sjögren 2004
This is an alternative build system that delegates everything to the @make@
program . All the commands just end up calling @make@ with appropriate
makefiles to be wrapped into Cabal packages . In practice essentially all
Haskell tools using a backend build system base... |
9e2fef88bf47378ac47156ac20c5147cc638f86a0cae8485214dfbb11593e0af | haskellfoundation/error-message-index | Main.hs | module Example (Example) where
data Example = Example { answer :: Int }
| null | https://raw.githubusercontent.com/haskellfoundation/error-message-index/6b80c2fe6d8d2941190bda587bcea6f775ded0a4/message-index/messages/GHC-47854/example2/after/Main.hs | haskell | module Example (Example) where
data Example = Example { answer :: Int }
| |
6d30bd42e4bddd188092b4406857a08ca4288b5c62ba84561acb052d615ec041 | zenspider/schemers | exercise.4.53.scm | #!/usr/bin/env csi -s
(require rackunit)
Exercise 4.53
;; With `permanent-set!' as described in *Note
Exercise 4 - 51 : : and ` if - fail ' as in * Note Exercise 4 - 52 : : , what
;; will be the result of evaluating
;;
;; (let ((pairs '()))
( if - fail ( let ( ( p ( prime - sum - pair ' ( 1 3 5 8) ... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.53.scm | scheme | With `permanent-set!' as described in *Note
will be the result of evaluating
(let ((pairs '()))
(permanent-set! pairs (cons p pairs))
(amb))
pairs))
no | #!/usr/bin/env csi -s
(require rackunit)
Exercise 4.53
Exercise 4 - 51 : : and ` if - fail ' as in * Note Exercise 4 - 52 : : , what
( if - fail ( let ( ( p ( prime - sum - pair ' ( 1 3 5 8) ' ( 20 35 110 ) ) ) )
|
491d9b0cb1a03a76df4bf09376b7e298d7f944e955fcfa16d34a09e41e410e6b | jmbr/maxima-interface | high-level-interface.lisp | (in-package :maxima-interface)
Some of the operators used by Maxima are listed in comm.lisp .
(defparameter *lisp-to-maxima*
'((= . (maxima::mequal))
(/= . (maxima::mnotequal))
(+ . (maxima::mplus))
(- . (maxima::mminus))
(* . (maxima::mtimes))
(sqrt ... | null | https://raw.githubusercontent.com/jmbr/maxima-interface/b30135104b6c0dc52761690607e4a683c7adb0a6/high-level-interface.lisp | lisp | Deal with special cases. | (in-package :maxima-interface)
Some of the operators used by Maxima are listed in comm.lisp .
(defparameter *lisp-to-maxima*
'((= . (maxima::mequal))
(/= . (maxima::mnotequal))
(+ . (maxima::mplus))
(- . (maxima::mminus))
(* . (maxima::mtimes))
(sqrt ... |
1226082697286cc808785c0a8c4664716e94d78a4f2cae048a0625e0b213f655 | haskell-repa/repa | ForeignPtr.hs |
module Data.Array.Repa.Repr.ForeignPtr
( F, Array (..)
, fromForeignPtr, toForeignPtr
, computeIntoS, computeIntoP)
where
import Data.Array.Repa.Shape
import Data.Array.Repa.Base
import Data.Array.Repa.Eval.Load
import Data.Array.Repa.Eval.Target
import Data.Array.Repa.Repr.Delayed
import For... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa/Data/Array/Repa/Repr/ForeignPtr.hs | haskell | | Arrays represented as foreign buffers in the C heap.
| Read elements from a foreign buffer.
# INLINE linearIndex #
Load -----------------------------------------------------------------------
| Filling foreign buffers.
CAREFUL: Unwrapping the foreignPtr like this means we need to be careful
to touch it after th... |
module Data.Array.Repa.Repr.ForeignPtr
( F, Array (..)
, fromForeignPtr, toForeignPtr
, computeIntoS, computeIntoP)
where
import Data.Array.Repa.Shape
import Data.Array.Repa.Base
import Data.Array.Repa.Eval.Load
import Data.Array.Repa.Eval.Target
import Data.Array.Repa.Repr.Delayed
import For... |
641250e0aa319262346f47f9853349bd968c0b63d1edec30bb253c2ada7d4b96 | ocamllabs/cosmetrics | main.ml | open Lwt
open CalendarLib
module C = Cosmetrics
module T = C.Timeseries
module H = Cosmetrics_html
open Cosmetrics_utils
let is_finite x = neg_infinity < x && x < infinity
let is_main_author s =
Cosmetrics.Summary.(s.n > 5 && s.pct > 1.)
let list_people html commits =
let summary = Cosmetrics.Summary.make commit... | null | https://raw.githubusercontent.com/ocamllabs/cosmetrics/8e27c47ccb0fe36fa7738eed53651e9e4472130d/src/main.ml | ocaml | Graph of "% of commits" → "# of authors".
[n] is the number of bins (for the range)
Given an array [a] sorted in increasing order and [x] such that
[a.(i0) <= x < a.(i1)], find [i] such that [a.(i) <= x < a.(i+1)].
Match to the start of the chosen period.
Create the matrix
For each transition to another ... | open Lwt
open CalendarLib
module C = Cosmetrics
module T = C.Timeseries
module H = Cosmetrics_html
open Cosmetrics_utils
let is_finite x = neg_infinity < x && x < infinity
let is_main_author s =
Cosmetrics.Summary.(s.n > 5 && s.pct > 1.)
let list_people html commits =
let summary = Cosmetrics.Summary.make commit... |
0044564f1d41648febec1743f83f7c7323372654862ff5bedaae3c0b7ef46ef6 | willemdj/erlsom | erlsom_simple_form.erl | Copyright ( C ) 2006 - 2008
%%%
This file is part of Erlsom .
%%%
Erlsom is free software : you can redistribute it and/or modify
%%% it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation , either version 3 of
the License , or ( at your option ) any later ... | null | https://raw.githubusercontent.com/willemdj/erlsom/19883e01a36c8927a770f0f46c3b96bbe9ad90ce/src/erlsom_simple_form.erl | erlang |
it under the terms of the GNU Lesser General Public License as
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
</>.
Author contact:
user interface
It is also possible to call erlsom_simple_form:callback from within
another callb... | Copyright ( C ) 2006 - 2008
This file is part of Erlsom .
Erlsom is free software : you can redistribute it and/or modify
published by the Free Software Foundation , either version 3 of
the License , or ( at your option ) any later version .
Erlsom is distributed in the hope that it will be useful ,
GN... |
bcd24866641fed27de3dae545cef9040aacc9b11299453ffc90e2f77b4c3d4fc | yuriy-chumak/ol | platform.scm | (define-library (OpenGL platform)
(version 1.2)
(license MIT/LGPL3)
(description
"Platform-specific types and definitions for OpenGL")
(export
(exports (otus ffi))
GL types
;
unsigned 32 - bit
unsigned byte ( GL_TRUE or )
unsigned 32 - bit
signed 8 - bit
signed 16 - bit
si... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/5e00a1d1df8a8f20d5d6b7714275a1578a56b8a0/libraries/OpenGL/platform.scm | scheme |
void, void*
* ol internal
* ol specific
============================================================================
== implementation ==========================================================
= OS DEPENDENT part ===============
-=( Linux )=--------------------------------------
-=( Windows )=-------------... | (define-library (OpenGL platform)
(version 1.2)
(license MIT/LGPL3)
(description
"Platform-specific types and definitions for OpenGL")
(export
(exports (otus ffi))
GL types
unsigned 32 - bit
unsigned byte ( GL_TRUE or )
unsigned 32 - bit
signed 8 - bit
signed 16 - bit
signed 3... |
984a824011b39b62adfdfa26761f76b9d0ef9fba5f5178539ddae81511c12448 | hipsleek/hipsleek | gProcList.ml | #include "xdebug.cppo"
(**/**)
open GUtil.SourceUtil
(**/**)
(**/**)
let cols = new GTree.column_list
let col_id = cols#add Gobject.Data.int
let col_line = cols#add Gobject.Data.int
let col_name = cols#add Gobject.Data.string
let col_validity = cols#add Gobject.Data.string
(**/**)
(**
Procedure list model
Used ... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/bef_indent/gProcList.ml | ocaml | */*
*/*
*/*
*/*
*
Procedure list model
Used for procedure list view below
*
procedure list view
| #include "xdebug.cppo"
open GUtil.SourceUtil
let cols = new GTree.column_list
let col_id = cols#add Gobject.Data.int
let col_line = cols#add Gobject.Data.int
let col_name = cols#add Gobject.Data.string
let col_validity = cols#add Gobject.Data.string
class procedure_list_model ?(src = "") () =
object (self)
val ... |
1e79f28e0d938464f8c16f2028cab0d123b3fcc3528bd52f003c0ded2a670ce9 | iSECPartners/scout | ec2.clj | (ns scout.ec2
(:require clojure.data))
; I know this is a huge hack. Please don't lock me under the stairs again.
(def ^:dynamic *ignored-ports* ())
(def ^:dynamic *flagged-ports* ())
(defn- graph-from-groups
"This ugly beheamoth of a function takes a seq of SecurityGroup objects and
turns them into a nice sort... | null | https://raw.githubusercontent.com/iSECPartners/scout/25a17aa735292c78bb596d651869e3f8555c033d/src/scout/ec2.clj | clojure | I know this is a huge hack. Please don't lock me under the stairs again.
ssh
rdp
mysql
orcale
ms-sql
postgres
memcached
mongodb
mongodb web interface
redis
ldap
old-fashioned plaintext protocols cause user harassment
telnet | (ns scout.ec2
(:require clojure.data))
(def ^:dynamic *ignored-ports* ())
(def ^:dynamic *flagged-ports* ())
(defn- graph-from-groups
"This ugly beheamoth of a function takes a seq of SecurityGroup objects and
turns them into a nice sorted set that we can do use to audit and compare
groups"
[groups]
(appl... |
973e30e3e831508c26dfc6eaebff5095cdd2c95b900ca3101580d307902ec8f9 | quil-lang/quilc | circle.lisp | ;;;; src/discrete/numeric/circle.lisp
;;;;
Author :
(cl:in-package #:cl-quil.discrete/numeric)
Operations on the complex Circle group and its subgroups
;;; (e.g. roots of unity)
(coalton-toplevel
(define-class ((Group :a) => Circle :a :b)
"A class representing a complex unit circle."
(circleReal (:a... | null | https://raw.githubusercontent.com/quil-lang/quilc/e04c4d3fb9b7b1028ab7faaff1a3bf692dcb3d44/src/discrete/numeric/circle.lisp | lisp | src/discrete/numeric/circle.lisp
(e.g. roots of unity)
Sin
Cos | Author :
(cl:in-package #:cl-quil.discrete/numeric)
Operations on the complex Circle group and its subgroups
(coalton-toplevel
(define-class ((Group :a) => Circle :a :b)
"A class representing a complex unit circle."
(circleReal (:a -> :b))
(circleImag (:a -> :b))
(circleComplex (:a -> (Compl... |
9277fa51228a8e65e17d0e6c4172560c60096c98f41d6199323f40d8a3b602c4 | jimburton/scrabble | Pretty.hs | {-# LANGUAGE OverloadedStrings #-}
|
Module : Scrabble . Board . Pretty
Description : Pretty printing of Scrabble boards .
Maintainer : : experimental
Portability : POSIX
Functions for pretty - printing a Scrabble board .
Module : Scrabble.Board.Pretty
Description : Pretty printing of Sc... | null | https://raw.githubusercontent.com/jimburton/scrabble/1d8e5e0203490812b32d8ce8fc2533750a4ea7d5/src/Scrabble/Board/Pretty.hs | haskell | # LANGUAGE OverloadedStrings #
* Functions for turning boards into text
Get all rows from the board
| Textify a board.
^ Whether to show bonus squares.
^ The board.
^ The text representation of the board.
| Textify the board and the current player.
^ Whether to show bonus squares.
^ The board.
^ The player.
... | |
Module : Scrabble . Board . Pretty
Description : Pretty printing of Scrabble boards .
Maintainer : : experimental
Portability : POSIX
Functions for pretty - printing a Scrabble board .
Module : Scrabble.Board.Pretty
Description : Pretty printing of Scrabble boards.
Maintainer :
Stabi... |
b34afe031277477ae3cbcf75032418b17414e3d548ecfe9a17e09d1f4f9c6ead | alanz/ghc-exactprint | TH_bracket1.hs | -- Check that declarations in a bracket shadow the top-level
# LANGUAGE TemplateHaskell #
-- declarations, rather than clashing with them.
module TH_bracket1 where
foo = 1
bar = [d| foo = 1 |]
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc86/TH_bracket1.hs | haskell | Check that declarations in a bracket shadow the top-level
declarations, rather than clashing with them. | # LANGUAGE TemplateHaskell #
module TH_bracket1 where
foo = 1
bar = [d| foo = 1 |]
|
e56dc9215b2bb7cbd71cc1bb61f1175658aa5edb546b9dceb32523fbfef1726d | janestreet/base | int63_emul.mli | * [ Int63_emul ] implements 63 - bit integers using the [ int64 ] type . It is is used to
implement [ Int63 ] on 32 - bit platforms ; see [ Int63_backends . Emulated ] .
implement [Int63] on 32-bit platforms; see [Int63_backends.Emulated]. *)
open! Import
type t [@@deriving_inline globalize]
val globaliz... | null | https://raw.githubusercontent.com/janestreet/base/1462b7d5458e96569275a1c673df968ecbf3342f/src/int63_emul.mli | ocaml | * [ Int63_emul ] implements 63 - bit integers using the [ int64 ] type . It is is used to
implement [ Int63 ] on 32 - bit platforms ; see [ Int63_backends . Emulated ] .
implement [Int63] on 32-bit platforms; see [Int63_backends.Emulated]. *)
open! Import
type t [@@deriving_inline globalize]
val globaliz... | |
a6abed7b1e9f40dfd9000b9ea7abf2105975ddb53c42d77118e3263f8250e84b | evturn/programming-in-haskell | 06.8-exercises.hs | Exercises 6.8
1 .
-- Modify the factorial function to prohibit negative arguments by adding a guard
-- to the recursive case.
factorial :: Int -> Int
factorial n
| n < 0 = 0
| n == 0 = 1
| n > 0 = n * factorial (n - 1)
2 .
-- Define a recursive function that returns the sum of non-negative numbers from... | null | https://raw.githubusercontent.com/evturn/programming-in-haskell/0af2c48c8221b5bcd052492e2be2b79635f6994c/06-recursive-functions/06.8-exercises.hs | haskell | Modify the factorial function to prohibit negative arguments by adding a guard
to the recursive case.
Define a recursive function that returns the sum of non-negative numbers from a
Define the exponentiation operator `^` for non-negative integers using the same
pattern of recursion as the multiplication operator ... | Exercises 6.8
1 .
factorial :: Int -> Int
factorial n
| n < 0 = 0
| n == 0 = 1
| n > 0 = n * factorial (n - 1)
2 .
given value down to zero .
sumdown :: Int -> Int
sumdown 0 = 0
sumdown n = n + sumdown (n - 1)
3 .
(<^>) :: Int -> Int -> Int
0 <^> _ = 0
n <^> 0 = 1
n <^> 1 = n
n <^> m = n * (n <^> ... |
8b1e97975787d4bf1277357d878c2b8904563c333fe86257932fe3831e8f7ba7 | zshipko/ocaml-py | test.ml | type counter = {
mutable pass: int;
mutable fail: int;
}
let start () = {
pass = 0;
fail = 0;
}
let red s =
"\027[0;31m" ^ s ^ "\027[0m"
let green s =
"\027[0;32m" ^ s ^ "\027[0m"
let check counter name v x =
let _ = Printf.printf "Running %s ..... " name in
try
if v () <> x ... | null | https://raw.githubusercontent.com/zshipko/ocaml-py/c6c94d8fea0c69e34cb89df52f63ae86be837a45/test/test.ml | ocaml | type counter = {
mutable pass: int;
mutable fail: int;
}
let start () = {
pass = 0;
fail = 0;
}
let red s =
"\027[0;31m" ^ s ^ "\027[0m"
let green s =
"\027[0;32m" ^ s ^ "\027[0m"
let check counter name v x =
let _ = Printf.printf "Running %s ..... " name in
try
if v () <> x ... | |
1229329a4ee3a849e2ff5a641247bed61ab2250e518732b8939f10d3180131b6 | mattgreen/hython | Interpreter.hs | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleInstances , MultiParamTypeClasses , OverloadedStrings #
module Hython.Interpreter
where
import Prelude hiding (readFile)
import Control.Monad (filterM, forM_, unless, void)
import Control.Monad.Except (ExceptT, runExceptT, throwError, MonadError)
import Control.Monad.C... | null | https://raw.githubusercontent.com/mattgreen/hython/fcbde98e9b5a033f0d4bea73ac9914bc5e12b746/src/Hython/Interpreter.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleInstances , MultiParamTypeClasses , OverloadedStrings #
module Hython.Interpreter
where
import Prelude hiding (readFile)
import Control.Monad (filterM, forM_, unless, void)
import Control.Monad.Except (ExceptT, runExceptT, throwError, MonadError)
import Control.Monad.C... | |
12a8c6f57bb29dae2c4893209e7e320f2d3f3fad69e9730f290613dd8d8240f9 | haskell-effectful/effectful | PluginTests.hs | -- Tests copied from polysemy-plugin:
--
--
( c ) 2019 , licensed under BSD-3 - Clause
# LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-unused-foralls -fplugin=Effectful.Plugin #-}
module Main where
import Data.String
import Unsafe.Coerce
import Effectful
import Effectfu... | null | https://raw.githubusercontent.com/haskell-effectful/effectful/0c66324baf95e5479c3b0bea4fea49f3ba41af22/effectful-plugin/tests/PluginTests.hs | haskell | Tests copied from polysemy-plugin:
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -Wno-unused-foralls -fplugin=Effectful.Plugin #
--------------------------------------
Tests
The plugin disambiguates effects for concrete rows too |
( c ) 2019 , licensed under BSD-3 - Clause
# LANGUAGE AllowAmbiguousTypes #
module Main where
import Data.String
import Unsafe.Coerce
import Effectful
import Effectful.Dispatch.Dynamic
import Effectful.Error.Static
import Effectful.State.Static.Local
main :: IO ()
main = pure ()
class MPTC a b where
mptc ... |
43f728f9dd75421d91664e9c4d9fb59c7cb47189816912c267a9a6319dd59601 | amnh/PCG | Evaluation.hs | -----------------------------------------------------------------------------
-- |
-- Module : Control.Evaluation
Copyright : ( c ) 2015 - 2021 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- The Evaluation type for representing ... | null | https://raw.githubusercontent.com/amnh/PCG/9341efe0ec2053302c22b4466157d0a24ed18154/lib/evaluation/src/Control/Evaluation.hs | haskell | ---------------------------------------------------------------------------
|
Module : Control.Evaluation
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
The Evaluation type for representing a computational context.
--------------------------------------------... | Copyright : ( c ) 2015 - 2021 Ward Wheeler
module Control.Evaluation
( EvaluationT()
, Evaluation()
, EvaluationResult()
, Notification(..)
, ErrorPhase(..)
, runEvaluation
, runEvaluationT
, evaluateResult
, evaluateEither
, failWithPhase
, renderNotification
, showRun
) where
import... |
659cb1ef7e4f2805310a3c30bb7ac14059ed474b517da1ff9424a7c23eec4394 | herd/herdtools7 | collectRegs.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/3e2e3e3680887cbf27e78810326ecb877d0faf1f/tools/collectRegs.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2016 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
dd77f326df90a1770fa5f4e3799bc94ce80f058a44b24cd6f7db13f533054df1 | dawranliou/comment | user.clj | (ns user
(:require
[integrant.repl :as ig-repl]
[comment.system :as system]
[comment.config :as config]))
(ig-repl/set-prep! config/system-config)
(def go ig-repl/go)
(def halt ig-repl/halt)
(def reset ig-repl/reset)
(defn system []
integrant.repl.state/system)
(comment
(go)
(reset)
(halt))
| null | https://raw.githubusercontent.com/dawranliou/comment/6ab9a1d3b704b14073f22e87922c8213a2aab57c/dev/user.clj | clojure | (ns user
(:require
[integrant.repl :as ig-repl]
[comment.system :as system]
[comment.config :as config]))
(ig-repl/set-prep! config/system-config)
(def go ig-repl/go)
(def halt ig-repl/halt)
(def reset ig-repl/reset)
(defn system []
integrant.repl.state/system)
(comment
(go)
(reset)
(halt))
| |
05ab71829904f2b7c00afbb8a2adac85b2d872fee524af5c2b401a540c06d2ef | ghosthamlet/algorithm-data-structure | bridges.clj | (ns algorithm-data-structure.algorithms.graph.bridges
"-algorithms/tree/master/src/algorithms/graph/bridges"
(:require [algorithm-data-structure.data-structures.graph :as g]
[algorithm-data-structure.data-structures.graph-vertex :as gv]
[algorithm-data-structure.algorithms.graph.depth-first-... | null | https://raw.githubusercontent.com/ghosthamlet/algorithm-data-structure/017f41a79d8b1d62ff5a6cceffa1b0f0ad3ead6b/src/algorithm_data_structure/algorithms/graph/bridges.clj | clojure | (ns algorithm-data-structure.algorithms.graph.bridges
"-algorithms/tree/master/src/algorithms/graph/bridges"
(:require [algorithm-data-structure.data-structures.graph :as g]
[algorithm-data-structure.data-structures.graph-vertex :as gv]
[algorithm-data-structure.algorithms.graph.depth-first-... | |
8eb986ae9feb636c3e5a91d4fc03658183eaf149c7a8ec752ddd35af2fa8627d | let-def/lrgrep | Memoize.mli | (******************************************************************************)
(* *)
(* Fix *)
(* ... | null | https://raw.githubusercontent.com/let-def/lrgrep/29e64174dc9617bcd1871fd2e4fd712269568324/lib/fix/Memoize.mli | ocaml | ****************************************************************************
Fix
... | , Paris
. All rights reserved . This file is distributed under the
terms of the GNU Library General Public License version 2 , with a
open Sigs
module Make
(M : MINIMAL_IMPERATIVE_MAPS)
: MEMOIZER with type key = M.key
and ... |
402a935bd43f3f387f5a1681e676332d3b6a4f08efe63ed705b95710f4b43d77 | lambdacube3d/lambdacube-quake3 | Player.hs | # LANGUAGE LambdaCase , RecordWildCards , TupleSections , NoMonomorphismRestriction , FlexibleContexts #
module Player where
import Entities
import World
import Monads
import Visuals
import Items
import Movers
import LoadResources(itemMap, weaponInfoMap)
import Collision
import Control.Monad
import Control.Monad.Writ... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-quake3/2fbc17eeea7567f2876d86a7ccce4bd8c8e1927c/game/Player.hs | haskell | -Weapon behaviours
-
We can add actions here to damage the entities in entityHits
changes player velocity according to user input
| Spawn a player if there is none.
death | # LANGUAGE LambdaCase , RecordWildCards , TupleSections , NoMonomorphismRestriction , FlexibleContexts #
module Player where
import Entities
import World
import Monads
import Visuals
import Items
import Movers
import LoadResources(itemMap, weaponInfoMap)
import Collision
import Control.Monad
import Control.Monad.Writ... |
2c3fe1370d6bd85b8ae91f1577a6621548ed0e71f3ecb11e2273bed191bdc683 | Tclv/HaskellBook | List.hs | module List where
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data List a =
Nil
| Cons a (List a)
deriving (Eq, Show)
instance Arbitrary a => Arbitrary (List a) where
arbitrary = oneof [Cons <$> arbitrary <*> arbitrary, return Nil]
instance (Eq a) => EqProp (List ... | null | https://raw.githubusercontent.com/Tclv/HaskellBook/78eaa5c67579526b0f00f85a10be3156bc304c14/ch17/List.hs | haskell | module List where
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data List a =
Nil
| Cons a (List a)
deriving (Eq, Show)
instance Arbitrary a => Arbitrary (List a) where
arbitrary = oneof [Cons <$> arbitrary <*> arbitrary, return Nil]
instance (Eq a) => EqProp (List ... | |
3ddddd6b96c1abec4c166743f6f06c6154eea1cd1fc2b50ef9b631ae8d38747e | VisionsGlobalEmpowerment/webchange | views.cljs | (ns webchange.ui.components.logo.views
(:require
[webchange.ui.components.logo.logo-with-name :as logo-with-name-svg]
[webchange.ui.utils.get-class-name :refer [get-class-name]]))
(defn logo-with-name
[{:keys [class-name]}]
[:div {:class-name (get-class-name {"bbs--logo-with-name" true
... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/e5747e187937d85e9c92c728d52a704f323f00ef/src/cljs/webchange/ui/components/logo/views.cljs | clojure | (ns webchange.ui.components.logo.views
(:require
[webchange.ui.components.logo.logo-with-name :as logo-with-name-svg]
[webchange.ui.utils.get-class-name :refer [get-class-name]]))
(defn logo-with-name
[{:keys [class-name]}]
[:div {:class-name (get-class-name {"bbs--logo-with-name" true
... | |
c887cde85a399c1468e48e69457b2def494429eef12f028686d62e01aebec0cd | intermine/bluegenes-old | view.cljs | (ns bluegenes.components.venn.view
(:require [re-frame.core :as re-frame]
;[bluegenes.components.venn.handlers]
;[bluegenes.components.venn.subs]
[bluegenes.utils.maths :as maths]
[reagent.core :as reagent]
[dommy.core :as dommy :refer-macros [sel sel1]]))
(def width 500)
... | null | https://raw.githubusercontent.com/intermine/bluegenes-old/5b719c7ac83a7340e0ff65790cf42413c15fb7e9/src/cljs/bluegenes/components/venn/view.cljs | clojure | [bluegenes.components.venn.handlers]
[bluegenes.components.venn.subs] | (ns bluegenes.components.venn.view
(:require [re-frame.core :as re-frame]
[bluegenes.utils.maths :as maths]
[reagent.core :as reagent]
[dommy.core :as dommy :refer-macros [sel sel1]]))
(def width 500)
(def height 500)
(def anchor1 {:x (- (* .33 width) (/ width 2)) :y 0})
(def anc... |
4e35b336df8f0c3d2078e4517ed6e7a3fd508cb6be58eb8599efca18fa306829 | namin/biohacker | cltms.lisp | ;;; -*- Mode: LISP; Syntax: Common-lisp; -*-
Complete logic - based truth maintenance system , version 16 of 4/26/92
Requires LTMS version 39 .
Last edited 1/29/93 , by KDF
Copyright ( c ) 1988 - 1992 , , Northwestern University ,
and , the Xerox Corporation .
;;; All rights reserved.
;;; See the fi... | null | https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/BPS/ltms/cltms.lisp | lisp | -*- Mode: LISP; Syntax: Common-lisp; -*-
All rights reserved.
See the file legal.txt for a paragraph stating scope of permission
and disclaimer of warranty. The above copyright notice and that
paragraph must be included in any separate copy of this file.
Adding formulas and clauses.
Add clause
Maintaining the ... |
Complete logic - based truth maintenance system , version 16 of 4/26/92
Requires LTMS version 39 .
Last edited 1/29/93 , by KDF
Copyright ( c ) 1988 - 1992 , , Northwestern University ,
and , the Xerox Corporation .
(cond
((boundp '*pack-ltms*)
(defpackage :PLTMS
(:use :COMMON-LISP))
(... |
adbfc5dfec3f2deb139f6acc04c21081492a8b259812f8c4f786d9f763f745d1 | lsrcz/mini-prover | Apply.hs | module MiniProver.Proof.Tactics.Apply (
handleApply
) where
import MiniProver.Proof.ProofDef
import MiniProver.Core.Syntax
import MiniProver.Core.Typing
import MiniProver.Core.SimplifyIndType
import MiniProver.PrettyPrint.PrettyPrint
import MiniProver.Core.Context
import MiniProver.Core.Reduction
import MiniProv... | null | https://raw.githubusercontent.com/lsrcz/mini-prover/0aa4cdf3b495ddf6707f27dcbee810d519b43177/src/MiniProver/Proof/Tactics/Apply.hs | haskell | ??????????????? | module MiniProver.Proof.Tactics.Apply (
handleApply
) where
import MiniProver.Proof.ProofDef
import MiniProver.Core.Syntax
import MiniProver.Core.Typing
import MiniProver.Core.SimplifyIndType
import MiniProver.PrettyPrint.PrettyPrint
import MiniProver.Core.Context
import MiniProver.Core.Reduction
import MiniProv... |
66d604903a59f5f7094a158ada8f52fa71ad694f51320d6de69919a4aeb03046 | DSiSc/why3 | compress.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/session/compress.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
val compression_supported : bool
module type S = sig
type out_channel
val open_out: string -> out_chann... |
698b103be9459d9d12d63359ad80fa4acb8bc8b65b56dd4781f83090435e2f00 | ocaml-opam/opam-compiler | opam.ml | open! Import
type spec = A of string | L of spec list | Set_env of string * string
let add_env env kv = Some (kv :: Option.value env ~default:[])
let rec add_spec (cmd, env) = function
| A s -> (Bos.Cmd.(cmd % s), env)
| L l -> add_spec_list (cmd, env) l
| Set_env (k, v) -> (cmd, add_env env (k, v))
and add_s... | null | https://raw.githubusercontent.com/ocaml-opam/opam-compiler/0e4d8e2547c839d32da995d6748f55c4a56183a1/lib/opam.ml | ocaml | open! Import
type spec = A of string | L of spec list | Set_env of string * string
let add_env env kv = Some (kv :: Option.value env ~default:[])
let rec add_spec (cmd, env) = function
| A s -> (Bos.Cmd.(cmd % s), env)
| L l -> add_spec_list (cmd, env) l
| Set_env (k, v) -> (cmd, add_env env (k, v))
and add_s... | |
1c78c053c35ff396edabdd743e2294594e93941b4702a8f7b14f0f5e93ebb478 | ijvcms/chuanqi_dev | instance_dark_lib.erl | %%%-------------------------------------------------------------------
%%% @author qhb
( C ) 2016 , < COMPANY >
%%% @doc
%%% 未知暗殿及跨服暗殿
%%% @end
Created : 21 . 一月 2016 14:19
%%%-------------------------------------------------------------------
-module(instance_dark_lib).
%%
-include("common.hrl").
-include("recor... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/scene/instance/instance_dark_lib.erl | erlang | -------------------------------------------------------------------
@author qhb
@doc
未知暗殿及跨服暗殿
@end
-------------------------------------------------------------------
玩家下线后副本保留时间
刷新时间间隔(秒)
怪物可出现次数列表
API
====================================================================
API functions
=====================... | ( C ) 2016 , < COMPANY >
Created : 21 . 一月 2016 14:19
-module(instance_dark_lib).
-include("common.hrl").
-include("record.hrl").
-include("config.hrl").
-include("proto.hrl").
-include("cache.hrl").
-record(instance_dark_state, {
scene_sign,
已经出现过的怪物
}).
-export([
init/2,
on_timer/1,
on_obj_enter/2,
on_ob... |
c917d5526cade9438ea9565e8efc97b52e1688c0a80edcdaa2cf8f29e6878107 | cachix/cachix | NixCacheInfo.hs | module Cachix.Types.NixCacheInfo where
import Data.Aeson (FromJSON, ToJSON)
import Data.Swagger (ToSchema)
import Protolude
data NixCacheInfo = NixCacheInfo
{ storeDir :: Text,
wantMassQuery :: Integer,
priority :: Integer
}
deriving (Generic, Show, FromJSON, ToJSON, ToSchema, NFData)
| null | https://raw.githubusercontent.com/cachix/cachix/9ab7727239262e3727081278c1a988245053f454/cachix-api/src/Cachix/Types/NixCacheInfo.hs | haskell | module Cachix.Types.NixCacheInfo where
import Data.Aeson (FromJSON, ToJSON)
import Data.Swagger (ToSchema)
import Protolude
data NixCacheInfo = NixCacheInfo
{ storeDir :: Text,
wantMassQuery :: Integer,
priority :: Integer
}
deriving (Generic, Show, FromJSON, ToJSON, ToSchema, NFData)
| |
2b2551a09a4d714280ce5f8f2860730938c2c056bfc4a2c8a0c27c39cba7c3c1 | bit-ranger/scheme-bootstrap | test.scm | #lang scheme
(define a 1)
(define (test)
(define b a)
(define a 3)
a)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (new-builder)
(let* ([ls '()])
(define assembly (λ (x y)
(cond [(null? x) y]
[else (if true
... | null | https://raw.githubusercontent.com/bit-ranger/scheme-bootstrap/a9155ebd29efe1196854b2dcd76941357dab151e/test.scm | scheme | #lang scheme
(define a 1)
(define (test)
(define b a)
(define a 3)
a)
(define (new-builder)
(let* ([ls '()])
(define assembly (λ (x y)
(cond [(null? x) y]
[else (if true
(cons (car x)
... | |
ecef0adf4611e2d2f08bed74774c9bcd063682e8781d820e8e67a47e46cf6b2e | tschady/advent-of-code | d11_test.clj | (ns aoc.2022.d11-test
(:require
[aoc.2022.d11 :as sut]
[clojure.string :as str]
[clojure.test :refer :all]))
(def ex1 (->
"Monkey 0:
Starting items: 79, 98
Operation: new = old * 19
Test: divisible by 23
If true: throw to monkey 2
If false: throw to monkey 3
Monkey 1:
Starting items: 54, 65... | null | https://raw.githubusercontent.com/tschady/advent-of-code/4d119897230821f545dca5b4cba1f8024372639d/test/aoc/2022/d11_test.clj | clojure | (ns aoc.2022.d11-test
(:require
[aoc.2022.d11 :as sut]
[clojure.string :as str]
[clojure.test :refer :all]))
(def ex1 (->
"Monkey 0:
Starting items: 79, 98
Operation: new = old * 19
Test: divisible by 23
If true: throw to monkey 2
If false: throw to monkey 3
Monkey 1:
Starting items: 54, 65... | |
0cc72246cfde91cb4f7dc9a7cf4a12e24982bc79b79bc0bd779478c651e1b40d | project-oak/hafnium-verification | ondemand.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/backend/ondemand.mli | ocaml | * Module for on-demand analysis.
* Find a proc desc for the procedure, perhaps loading it from disk.
* Set the execution enviroment used during on-demand analysis.
* Empty the cache of ondemand results
* Remove an element from the cache of ondemand results
* Invoke all the callbacks registered in {!Callbacks} on t... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
ea24edafdad298fe3a2a6e862db10144a67e89fcf132ff40710f6b05fe75d2a4 | RefactoringTools/wrangler | eval_all.erl | %%%-------------------------------------------------------------------
@author , < >
( C ) 2013 ,
%%% @doc
This module was created with the aim of < b > mixing some refactorings and applying all their rules toghether</b > . Thus , this refactoring just call the others refactorings ( arithmetics , iden... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/1c33ad0e923bb7bcebb6fd75347638def91e50a8/src/symbolic_evaluation/evaluator/eval_all.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
Include files
===================================================================
gen_refac callbacks
===================================================================... | @author , < >
( C ) 2013 ,
This module was created with the aim of < b > mixing some refactorings and applying all their rules toghether</b > . Thus , this refactoring just call the others refactorings ( arithmetics , identity and function applications ) . < p > For instance , the code < i>"f(X ) - > ... |
c316a25c331f37d9a15038bfcd218508c2b37f8b882fc0e9af85b21f250ce964 | janestreet/hardcaml | dedup.mli | (** Deduplicates combinatorial nodes performing redundant computation. *)
val deduplicate : Circuit.t -> Circuit.t
| null | https://raw.githubusercontent.com/janestreet/hardcaml/4126f65f39048fef5853ba9b8d766143f678a9e4/src/dedup.mli | ocaml | * Deduplicates combinatorial nodes performing redundant computation. |
val deduplicate : Circuit.t -> Circuit.t
|
595e89d1a3de15f094864f826d0d984135c0c54c2c69c9694165e28be0961bfc | kowainik/relude | CallStack.hs | {-# LANGUAGE Safe #-}
|
Module : Relude . Extra . CallStack
Copyright : ( c ) 2018 - 2023 Kowainik
SPDX - License - Identifier : MIT
Maintainer : < >
Stability : Stable
Portability : Portable
Contains useful functions to work... | null | https://raw.githubusercontent.com/kowainik/relude/e633cb33308d259d6e4ea058ef506eb496b12323/src/Relude/Extra/CallStack.hs | haskell | # LANGUAGE Safe # |
|
Module : Relude . Extra . CallStack
Copyright : ( c ) 2018 - 2023 Kowainik
SPDX - License - Identifier : MIT
Maintainer : < >
Stability : Stable
Portability : Portable
Contains useful functions to work with GHC callstack . ... |
47ee9bb9c9e016ed8c1146ac238f28e6aa35698e474c1e1b9a864a90d5748be1 | ghc/packages-Cabal | HttpUtils.hs | {-# LANGUAGE BangPatterns #-}
-----------------------------------------------------------------------------
-- | Separate module for HTTP actions, using a proxy server if one exists.
-----------------------------------------------------------------------------
module Distribution.Client.HttpUtils (
DownloadResult(.... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-install/Distribution/Client/HttpUtils.hs | haskell | # LANGUAGE BangPatterns #
---------------------------------------------------------------------------
| Separate module for HTTP actions, using a proxy server if one exists.
---------------------------------------------------------------------------
---------------------------------------------------------------------... | module Distribution.Client.HttpUtils (
DownloadResult(..),
configureTransport,
HttpTransport(..),
HttpCode,
downloadURI,
transportCheckHttps,
remoteRepoCheckHttps,
remoteRepoTryUpgradeToHttps,
isOldHackageURI
) where
import Prelude ()
import Distribution.Client.Compat.Prelude hidi... |
ef3e4bc9cda64f5fc92c1cbad57a699b4caface1de4dfd7803533805a51edc8d | cram2/cram | numerical-integration.lisp | Regression test NUMERICAL - INTEGRATION for GSLL , automatically generated
;;
Copyright 2009 , 2010 , 2015
Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/numerical-integration.lisp | lisp |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Publi... | Regression test NUMERICAL - INTEGRATION for GSLL , automatically generated
Copyright 2009 , 2010 , 2015
Distributed under the terms of the GNU General Public License
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
Yo... |
e5152d989009dfa67ca19e03142e63721f579c19fdecea7bf55586516859d23b | rizo/snowflake-os | format.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/stdlib/format.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : format.mli , v 1.74 2006 - 1... |
7067266e3a33603a60de181427f18c2d8c9dc1a3931253fcc3316cac6fdb5ff1 | vsedach/Parenscript | special-operators.lisp | Copyright 2005
Copyright 2005 - 2006 Edward
Copyright 2007 - 2012
Copyright 2011 - 2013
Copyright 2014
SPDX - License - Identifier : BSD-3 - Clause
;;; Redistribution and use in source and binary forms, with or
;;; without modification, are permitted provided that the following
;;; conditions ar... | null | https://raw.githubusercontent.com/vsedach/Parenscript/b8dd346d482b730a052902be1af724b16c6f2979/src/special-operators.lisp | lisp | Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other mate... | Copyright 2005
Copyright 2005 - 2006 Edward
Copyright 2007 - 2012
Copyright 2011 - 2013
Copyright 2014
SPDX - License - Identifier : BSD-3 - Clause
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above
3 . Neither ... |
c9aaf9ed7b5cbd958b8a4e5d89e19205482bc28d1481f724e78af62ea36b5784 | s312569/clj-biosequence | aa-signalp.clj | {\A {:three "Ala"
:longname "Alanine"
:monoisotopic 71.03711
:average 71.0788
:pka 0}
\R {:three "Arg"
:longname "Arginine"
:monoisotopic 156.10111
:average 156.1875
:pka 12.4}
\N {:three "Asn"
:longname "Asparagine"
:monoisotopic 114.04293
:average 114.1038
... | null | https://raw.githubusercontent.com/s312569/clj-biosequence/b4d2a2750d8fd6a2b398d859879c193e00212415/resources/aa-signalp.clj | clojure | {\A {:three "Ala"
:longname "Alanine"
:monoisotopic 71.03711
:average 71.0788
:pka 0}
\R {:three "Arg"
:longname "Arginine"
:monoisotopic 156.10111
:average 156.1875
:pka 12.4}
\N {:three "Asn"
:longname "Asparagine"
:monoisotopic 114.04293
:average 114.1038
... | |
96ebe1ab88e5820dac6d11f5cfab2bd6a29e8434561f0f9031e039372fa48960 | mtolly/onyxite-customs | Perf.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Onyx.Neversoft.Perf where
import Control.Monad
import Data.Binary.Get
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Data.Word (Word32)
import Onyx... | null | https://raw.githubusercontent.com/mtolly/onyxite-customs/0c8acd6248fe92ea0d994b18b551973816adf85b/haskell/packages/onyx-lib/src/Onyx/Neversoft/Perf.hs | haskell | # LANGUAGE OverloadedStrings #
qb "perf"
always 0x36? | # LANGUAGE RecordWildCards #
module Onyx.Neversoft.Perf where
import Control.Monad
import Data.Binary.Get
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Data.Word (Word32)
import Onyx.Neversoft.CRC
import Ony... |
36890cdbf1dd906812e4dbcf976ea2c7552910bd42dd98a7896404345321103d | gas2serra/mcclim-desktop | main.lisp | (in-package :desktop-console)
(defun run-console (&key (new-process nil)
(width nil)
(height nil)
port
frame-manager
(pretty-name "Desktop Console")
(process-name "desktop-console"))
(let* ((fm (or frame-manager (clim:find-frame-manager :port (or port (clim:find-port))... | null | https://raw.githubusercontent.com/gas2serra/mcclim-desktop/f85d19c57d76322ae3c05f98ae43bfc8c0d0a554/Apps/console/gui/main.lisp | lisp | (in-package :desktop-console)
(defun run-console (&key (new-process nil)
(width nil)
(height nil)
port
frame-manager
(pretty-name "Desktop Console")
(process-name "desktop-console"))
(let* ((fm (or frame-manager (clim:find-frame-manager :port (or port (clim:find-port))... | |
6838bbed79e5e8ebebcaf1b5c72e0ad088a094bd034951eeae688cd58609c164 | senapk/fn_2020_1 | Main.hs | main = do
putStrLn "Digite nome e peso, um por linha please"
nome <- getLine --string
peso' <- getLine --string
let peso = read peso' :: Float
putStrLn ""
" nome : " + + nome + + " e peso : " + + show peso
| null | https://raw.githubusercontent.com/senapk/fn_2020_1/dd30b5d49300459a62b00299d65309f09638d8fc/s02e01_main/Main.hs | haskell | string
string | main = do
putStrLn "Digite nome e peso, um por linha please"
let peso = read peso' :: Float
putStrLn ""
" nome : " + + nome + + " e peso : " + + show peso
|
80037c4243ba02f5c8df2540f6d63a4f16a15e99bdaed8b8881ab73d5c4e4cb6 | dvanhorn/oaam | racket-to-sexp.rkt | #lang racket
(provide rkt->sexp sch->sexp
expand-sexp-expr
expand-sexp-prog)
;; expect top level forms
(define (sch->sexp file)
(top-level->sexp
(parameterize ([current-namespace (make-base-namespace)])
(with-input-from-file file
(lambda () (for/list ([form (in-port read-syntax)])
... | null | https://raw.githubusercontent.com/dvanhorn/oaam/79bc68ecb79fef45474a948deec1de90d255f307/code/racket-to-sexp.rkt | racket | expect top level forms
expect a #lang and module stuff.
#lang ok
ignore provide/require forms | #lang racket
(provide rkt->sexp sch->sexp
expand-sexp-expr
expand-sexp-prog)
(define (sch->sexp file)
(top-level->sexp
(parameterize ([current-namespace (make-base-namespace)])
(with-input-from-file file
(lambda () (for/list ([form (in-port read-syntax)])
(syntax... |
a6642c7814822dcf42299ebd9b4e352bc33171c1c99b9b38195f843214842684 | daangn/advent-of-code-2021 | day1.ml | let test_input = "199\n200\n208\n210\n200\n207\n240\n269\n260\n263"
let parse input = input |> String.split_on_char '\n' |> List.map int_of_string
let count elems =
let rec count_increases acc elems =
match elems with
| a :: b :: tail ->
let acc = if a < b then acc + 1 else acc in
b :: tail |... | null | https://raw.githubusercontent.com/daangn/advent-of-code-2021/7e18efb5bbf2d65057dd3ccda563ad1f3151fd56/ocaml/lib/day1.ml | ocaml | let test_input = "199\n200\n208\n210\n200\n207\n240\n269\n260\n263"
let parse input = input |> String.split_on_char '\n' |> List.map int_of_string
let count elems =
let rec count_increases acc elems =
match elems with
| a :: b :: tail ->
let acc = if a < b then acc + 1 else acc in
b :: tail |... | |
57af39b1f159a144d4d3c281959ae389e1ba255c8ae57aecb3b081fc06bf340a | mcorbin/meuse | core.clj | (ns meuse.core
(:require [meuse.auth.password :as password]
[mount.core :as mount]
meuse.http
[meuse.log :as log]
[signal.handler :refer [with-handler]])
(:gen-class))
(defn stop!
"Stops the application"
[]
(mount/stop))
(defn start!
"Start the application u... | null | https://raw.githubusercontent.com/mcorbin/meuse/d2b74543fce37c8cde770ae6f6097cabb509a804/src/meuse/core.clj | clojure | (ns meuse.core
(:require [meuse.auth.password :as password]
[mount.core :as mount]
meuse.http
[meuse.log :as log]
[signal.handler :refer [with-handler]])
(:gen-class))
(defn stop!
"Stops the application"
[]
(mount/stop))
(defn start!
"Start the application u... | |
04efafe1a27e2ecd9feabd1725e4a17bcbe65ec34600f64d486b457a4d751c18 | well-typed/large-records | Row030.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module Common.RowOfSize.Row030 (ExampleRow) where
import SuperRecord
import Bench.Types
type ExampleRow = [
-- 00 .. 09
"t00" := T 00
, "t01" := T 01
, "t02" := T 02
, "t03" := T 03
, "t04" := T 04
, "t05" := T 05
, "t06" := T 06
, "t07" :... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-records-benchmarks/bench/superrecord/Common/RowOfSize/Row030.hs | haskell | 00 .. 09 | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module Common.RowOfSize.Row030 (ExampleRow) where
import SuperRecord
import Bench.Types
type ExampleRow = [
"t00" := T 00
, "t01" := T 01
, "t02" := T 02
, "t03" := T 03
, "t04" := T 04
, "t05" := T 05
, "t06" := T 06
, "t07" := T 07
, "t08"... |
b97fb2afb6332dd2e979f23fd3673573ccdbf297178eaf26b7d3a2a6de721417 | Gabriella439/slides | Main.hs | -- exercises/07/Main.hs
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
import Data.Csv (FromNamedRecord(..), (.:))
import Data.Foldable (toList)
import Data.Text (Text)
import Data.Vector (Vector)
import qualified Data.ByteString.Lazy
import qualified Data.Csv
import qualified Data.List
import qu... | null | https://raw.githubusercontent.com/Gabriella439/slides/b3f4c33e3714e186c309aa791ca1bcce68b3cc74/lambdaconf/data/exercises/07/Main.hs | haskell | exercises/07/Main.hs
# LANGUAGE OverloadedStrings # |
# LANGUAGE RecordWildCards #
import Data.Csv (FromNamedRecord(..), (.:))
import Data.Foldable (toList)
import Data.Text (Text)
import Data.Vector (Vector)
import qualified Data.ByteString.Lazy
import qualified Data.Csv
import qualified Data.List
import qualified Data.Vector
data Nomen = Nomen
{ genus :: T... |
5e28011048e8237f9acaa8a2346c58096bc058359ea2b9f4d52efecb6437a961 | FieryCod/holy-lambda | registry.clj | (require '[selmer.parser :as selm])
(require '[babashka.process :as p])
(def BABASHKA_VERSION "0.8.157")
(defn- exit-non-zero
[proc]
(when-let [exit-code (some-> proc deref :exit)]
(when (not (zero? exit-code))
(System/exit exit-code))))
(defn- shell
[cmd]
(exit-non-zero (p/process (p/tokenize cmd)... | null | https://raw.githubusercontent.com/FieryCod/holy-lambda/d6e9a6e4aaebdf06835b708abf0dc87dce341610/docker/registry.clj | clojure | {:version ["22.2.0"]
:arch ["amd64", "aarch64"]}
{:version ["22.1.0"]
:arch ["amd64", "aarch64"]}
{:version ["22.0.0.2"]
:arch ["amd64", "aarch64"]}
{:version ["21.3.0"]
:java ["17"]
:arch ["amd64", "aarch64"]}
:java ["8"]
:arch ["amd64"]}
{:version "22.1.0-dev-20211209_230... | (require '[selmer.parser :as selm])
(require '[babashka.process :as p])
(def BABASHKA_VERSION "0.8.157")
(defn- exit-non-zero
[proc]
(when-let [exit-code (some-> proc deref :exit)]
(when (not (zero? exit-code))
(System/exit exit-code))))
(defn- shell
[cmd]
(exit-non-zero (p/process (p/tokenize cmd)... |
7d3da9bbd9a67c9a1cb2d03e5fd0fe382aa976e0887d4f2e229a9f96bbf48eaa | nextjournal/freerange | fx.cljc | (ns re-frame.fx
(:require [re-frame.router :as router]
[re-frame.interceptor :refer [->interceptor]]
[re-frame.interop :refer [set-timeout!]]
[re-frame.events :as events]
[re-frame.registry :as reg]
[re-frame.loggers :refer [console]]
[re-frame.t... | null | https://raw.githubusercontent.com/nextjournal/freerange/8cf68c30722a4c6f8f948a134c900d7a656ecad4/src/re_frame/fx.cljc | clojure | -- Registration ------------------------------------------------------------
-- Interceptor -------------------------------------------------------------
:dispatch-later
usage:
; in 200ms do this : ( dispatch [: event - id " param " ] )
Note: nil entries in the collection are ignored which means events can ... | (ns re-frame.fx
(:require [re-frame.router :as router]
[re-frame.interceptor :refer [->interceptor]]
[re-frame.interop :refer [set-timeout!]]
[re-frame.events :as events]
[re-frame.registry :as reg]
[re-frame.loggers :refer [console]]
[re-frame.t... |
1483569d39b5640c5cde63cd5d9fdc988e1c4106f7b44439642389cf4021d053 | leksah/leksah | Main.hs | # LANGUAGE CPP #
-----------------------------------------------------------------------------
--
-- Module : Main
Copyright : ( c ) ,
-- License : GNU-GPL
--
-- Maintainer : <maintainer at leksah.org>
-- Stability : provisional
-- Portability : portable
--
--
Main function of Leksah , ... | null | https://raw.githubusercontent.com/leksah/leksah/ec95f33af27fea09cba140d7cddd010935a2cf52/main/Main.hs | haskell | ---------------------------------------------------------------------------
Module : Main
License : GNU-GPL
Maintainer : <maintainer at leksah.org>
Stability : provisional
Portability : portable
-------------------------------------------------------------------------------
| Support for loc... | # LANGUAGE CPP #
Copyright : ( c ) ,
Main function of Leksah , an Haskell IDE written in Haskell
module Main (main) where
import System.Environment (getArgs)
import IDE.Leksah (leksah)
import IDE.TextEditor.Yi.Config (defaultYiConfig)
#ifdef LOCALIZATION
import Text.I18N.GetText
import System.Locale... |
b4b76838cdbe381b99892a8ebf0dce7f57be66366ffde11be18890dae0e5cf89 | isakmp/ike | engine.ml |
type initiator_state =
| Sa_init_sent of ??
| Auth_sent of ??
| Active
| Closing
type responder_state =
| Initial
| Sa_init_replied of ??
| Auth_replied of ??
| Active
| Closing
type state =
| Initiator of initiator_state
| Responder of responder_state
let active = function
| Initiator (Act... | null | https://raw.githubusercontent.com/isakmp/ike/fa93543941a77f6b09c88d8bb149dd0d40acc635/src/engine.ml | ocaml |
type initiator_state =
| Sa_init_sent of ??
| Auth_sent of ??
| Active
| Closing
type responder_state =
| Initial
| Sa_init_replied of ??
| Auth_replied of ??
| Active
| Closing
type state =
| Initiator of initiator_state
| Responder of responder_state
let active = function
| Initiator (Act... | |
22739babe09e42a74cf200ac64e0e73f7a562bb0eac8daa388f8a2c6af8b0184 | coq/coq | load.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/d627f2d7f8a0699c4497847a4882b0d38cbad703/toplevel/load.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
10f0349ce1902dc9b245700f9f8997c2eea7038f6263d73107fbf66e526cbc16 | shayan-najd/NativeMetaprogramming | PlatformSpecific.hs | module Options.PlatformSpecific where
import Types
platformSpecificOptions :: [Flag]
platformSpecificOptions =
[ flag { flagName = "-msse2"
, flagDescription = "(x86 only) Use SSE2 for floating-point operations"
, flagType = DynamicFlag
}
, flag { flagName = "-msse4.2"
, flagDe... | null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/utils/mkUserGuidePart/Options/PlatformSpecific.hs | haskell | module Options.PlatformSpecific where
import Types
platformSpecificOptions :: [Flag]
platformSpecificOptions =
[ flag { flagName = "-msse2"
, flagDescription = "(x86 only) Use SSE2 for floating-point operations"
, flagType = DynamicFlag
}
, flag { flagName = "-msse4.2"
, flagDe... | |
91543a072e2af74520433e4343195592e0ae376b12c673c861d9147819e532b2 | leafac/css-expr | info.rkt | #lang info
(define collection "css-expr")
(define version "0.0.2")
(define deps '("base" "rackunit-lib" "typed-racket-lib" "typed-racket-more" "nanopass"))
(define build-deps '("scribble-lib" "racket-doc" "sandbox-lib"))
(define scribblings '(("css-expr.scrbl" ())))
(define pkg-desc "S-expression-based CSS")
(define p... | null | https://raw.githubusercontent.com/leafac/css-expr/d060b2a76d08013c91318890dc5d9f6cc6c81138/info.rkt | racket | #lang info
(define collection "css-expr")
(define version "0.0.2")
(define deps '("base" "rackunit-lib" "typed-racket-lib" "typed-racket-more" "nanopass"))
(define build-deps '("scribble-lib" "racket-doc" "sandbox-lib"))
(define scribblings '(("css-expr.scrbl" ())))
(define pkg-desc "S-expression-based CSS")
(define p... | |
e3ac8836d7948269f792b9bd690c298dd1de56d0d39d4c7a9743d8760eab1b5f | c-cube/ocaml-containers | t_int.ml | open CCInt
module T = (val Containers_testlib.make ~__FILE__ ())
include T;;
eq ~printer:Q.Print.(list int) [ 0; 1; 2; 3; 4; 5 ] (range 0 5 |> Iter.to_list)
;;
eq ~printer:Q.Print.(list int) [ 0 ] (range 0 0 |> Iter.to_list);;
eq ~printer:Q.Print.(list int) [ 5; 4; 3; 2 ] (range 5 2 |> Iter.to_list);;
eq ~printer:Q.Pr... | null | https://raw.githubusercontent.com/c-cube/ocaml-containers/69f2805f1073c4ebd1063bbd58380d17e62f6324/tests/core/t_int.ml | ocaml | note: the last test checks that no error occurs due to overflows. | open CCInt
module T = (val Containers_testlib.make ~__FILE__ ())
include T;;
eq ~printer:Q.Print.(list int) [ 0; 1; 2; 3; 4; 5 ] (range 0 5 |> Iter.to_list)
;;
eq ~printer:Q.Print.(list int) [ 0 ] (range 0 0 |> Iter.to_list);;
eq ~printer:Q.Print.(list int) [ 5; 4; 3; 2 ] (range 5 2 |> Iter.to_list);;
eq ~printer:Q.Pr... |
11bdba7312a3b0c4591136e73618f53db8f4ac78e8da42f7f2fd299b54bb5679 | astro/prittorrent | url.erl | -module(url).
-export([join/2]).
join(Base, Target)
when is_binary(Base) ->
join(binary_to_list(Base),
Target
);
join(Base, Target)
when is_binary(Target) ->
list_to_binary(
join(Base,
binary_to_list(Target)
));
join(Base, Target) ->
ColonIndex =
length(lists:takewhile(fun($:) -... | null | https://raw.githubusercontent.com/astro/prittorrent/5173eeb8b00fd9ab7c0d347c9e361052023faebd/apps/shared/src/url.erl | erlang | -module(url).
-export([join/2]).
join(Base, Target)
when is_binary(Base) ->
join(binary_to_list(Base),
Target
);
join(Base, Target)
when is_binary(Target) ->
list_to_binary(
join(Base,
binary_to_list(Target)
));
join(Base, Target) ->
ColonIndex =
length(lists:takewhile(fun($:) -... | |
23404c1a70ff82131698accb9a6c36933385367f4f3691379d1bd71320ad6fe6 | TheLortex/mirage-monorepo | functions.ml |
* Copyright ( c ) 2016 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2016 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
(* Foreign function bindings ... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/ocaml-ctypes/tests/test-integers/stubs/functions.ml | ocaml | Foreign function bindings for the integer tests. |
* Copyright ( c ) 2016 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2016 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open Ctypes
module Stubs (F... |
b3b759e6800d306687df2e1127874de878eab6fc63bade523534186f0801f205 | danoctavian/bit-smuggler | Main.hs | {-# LANGUAGE OverloadedStrings #-}
import Prelude as P
import Data.Binary as Bin
import Data.ByteString as BS
import Data.ByteString.Lazy as BSL
import Data.ByteString.Char8 as BSC
import Data.ByteString.Lazy.Char8 as BSLC
import Data.String
import Data.Maybe
import Data.Text as Txt
import Control.Exception
import D... | null | https://raw.githubusercontent.com/danoctavian/bit-smuggler/4385ed67f1fec4ed441832fc9a119de632b796aa/scripts/Main.hs | haskell | # LANGUAGE OverloadedStrings #
project created to run experiments
logger = "scripts"
updateGlobalLogger logger (setLevel DEBUG)
debugM logger $ "clean result" P.++ (show r)
place file to be seeded
place file to be seeded
sleep for a while until that is announced; ideally i should put
close procs
this is... |
import Prelude as P
import Data.Binary as Bin
import Data.ByteString as BS
import Data.ByteString.Lazy as BSL
import Data.ByteString.Char8 as BSC
import Data.ByteString.Lazy.Char8 as BSLC
import Data.String
import Data.Maybe
import Data.Text as Txt
import Control.Exception
import Data.IP
import Network.Socket as NS
... |
f7d2e64d2597919bbca7aabc5b0958e8f7a844cf1d7d59f67fe48ebce3fef8b4 | fulcro-legacy/fulcro-incubator | db_helpers_test.clj | (ns fulcro.incubator.db-helpers-test
(:require [clojure.test :refer :all]
[fulcro.incubator.db-helpers :as db.h]
[fulcro-spec.core :refer [assertions]]))
(deftest test-gen-pessimistic-mutations
(assertions
"just remote"
(#'db.h/gen-pessimistic-mutation 'my-mutation '[args]
'((... | null | https://raw.githubusercontent.com/fulcro-legacy/fulcro-incubator/72885fcc944e16bf98aa42b5d1e518c0ce4574db/src/test/fulcro/incubator/db_helpers_test.clj | clojure | (ns fulcro.incubator.db-helpers-test
(:require [clojure.test :refer :all]
[fulcro.incubator.db-helpers :as db.h]
[fulcro-spec.core :refer [assertions]]))
(deftest test-gen-pessimistic-mutations
(assertions
"just remote"
(#'db.h/gen-pessimistic-mutation 'my-mutation '[args]
'((... | |
a969441f4528adf0bac3d55b0e5abef9c57d2b5ac2195be6baf066fafd93fde9 | incoherentsoftware/defect-process | Data.hs | module Player.Weapon.All.Gauntlets.Data
( GauntletsAttackDescriptions(..)
, GauntletsDataSprites(..)
, GauntletsData(..)
, mkGauntletsData
, isReleasableAtkConditionsMet
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Functor ((<&>))
import qualified Data.Map as M
import ... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/8797aad1d93bff5aadd7226c39a48f45cf76746e/src/Player/Weapon/All/Gauntlets/Data.hs | haskell | module Player.Weapon.All.Gauntlets.Data
( GauntletsAttackDescriptions(..)
, GauntletsDataSprites(..)
, GauntletsData(..)
, mkGauntletsData
, isReleasableAtkConditionsMet
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Functor ((<&>))
import qualified Data.Map as M
import ... | |
195a94f36f542b349bfe6bfda1e2ff0cb31b806ea6093f06bf8c509ce3eb9633 | fortytools/holumbus | PrefixTree.hs | # OPTIONS_GHC -fno - warn - unused - imports #
-- ----------------------------------------------------------------------------
|
Module : Holumbus . Data . PrefixTree
Copyright : Copyright ( C ) 2009 - 2010
License : MIT
Maintainer : ( )
Stability : experimental
Portabilit... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/searchengine/source/Holumbus/Data/PrefixTree.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
fuzzy search | # OPTIONS_GHC -fno - warn - unused - imports #
|
Module : Holumbus . Data . PrefixTree
Copyright : Copyright ( C ) 2009 - 2010
License : MIT
Maintainer : ( )
Stability : experimental
Portability : not portable
Facade for prefix tree implementation
Module : ... |
181e9f1802c50bc8bfa541af2a2d19f28b1f8918e5a6cdb274824c8245014d3e | c089/haskell-craft3e | Chapter10.hs | ------------------------------------------------------------------------------
--
Haskell : The Craft of Functional Programming , 3e
( c ) Addison - Wesley , 1996 - 2011 .
--
Chapter 10
--
-------------------------------------------------------------------------
-- Generalization: patterns of computatio... | null | https://raw.githubusercontent.com/c089/haskell-craft3e/869e382601cab50559c4473dfa9c7480f1acba58/Chapter10.hs | haskell | ----------------------------------------------------------------------------
-----------------------------------------------------------------------
Generalization: patterns of computation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Higher-order functions: functions as arguments
Mapping a function along a list.
^^... | Haskell : The Craft of Functional Programming , 3e
( c ) Addison - Wesley , 1996 - 2011 .
Chapter 10
module Chapter10 where
import Prelude hiding (map,filter,zipWith,foldr1,foldr,concat,and)
import Pictures hiding (flipV,beside)
import qualified Chapter7
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... |
ebe04c6e162af319cbefa9af74619d50b1e7855032a2ea69b68cc1ffad4516b9 | jbracker/supermonad | LibMT.hs |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/hmtc/original/LibMT.hs | haskell | :: [TAMInst]
declared in the standard environment as well as for internal use by the
about the meaning of many of these routines (\"add\" etc.) based on their
names for optimization purposes.
preinc
predec
postinc
postdec
add
sub
mul
div
pow
neg
lt
le
eq
ne
gt
and
or
not
getchr
putchr
getint
... |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... |
98a6b23c9a23461aa8f5c169a7855f29fd8f0a7f23e27f26b5f976f2693fef2e | cartazio/tlaps | optable.ml |
* optable.ml --- operator table
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* optable.ml --- operator table
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 33816 $";;
open Builtin
type fixity =
| Nonfix
| Prefix | Postfix
| Infix o... | null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/optable.ml | ocaml | primitive operators
user-definable operators
* Mapping from builtins to standard tlaops |
* optable.ml --- operator table
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* optable.ml --- operator table
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 33816 $";;
open Builtin
type fixity =
| Nonfix
| Prefix | Postfix
| Infix o... |
738dee54fc6a8cd133d1835c96263f3c901ebdd04f2e4fa774147df5c2cf7c68 | scrintal/heroicons-reagent | exclamation_circle.cljs | (ns com.scrintal.heroicons.mini.exclamation-circle)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 0... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/exclamation_circle.cljs | clojure | (ns com.scrintal.heroicons.mini.exclamation-circle)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 0... | |
0f34b32c5d84e8e2c0e0a719cf721a0d3d5cbf13055365504681816d54e0c8bf | k0dev/erlang-notes | die_togheter.erl | -module(die_togheter).
-export([example1/0, example2/0, example3/0, dummy/2, dummy/1]).
Situazione in %
% %
% P2 P1 P4 %
% / \ %
P6 P3 %
% \ ... | null | https://raw.githubusercontent.com/k0dev/erlang-notes/0f42d5e051f64f110e2ef22a7fd74336b9e9c3b2/code/examples/concurrency/die_togheter.erl | erlang |
%
P2 P1 P4 %
/ \ %
\ %
%
tutti i processi sono vivi
aspetto che i segnali di uscita si propaghino
rimangono solo i pro... | -module(die_togheter).
-export([example1/0, example2/0, example3/0, dummy/2, dummy/1]).
setup() ->
P1 = spawn(?MODULE, dummy, [p1]),
P2 = spawn(?MODULE, dummy, [p2]),
P3 = spawn(?MODULE, dummy, [p3, P2]),
P4 = spawn(?MODULE, dummy, [p4]),
P5 = spawn(?MODULE, dummy, [p5, P3]),
P6 = spawn(?MODUL... |
11fe82ffbd2d9a4ad8ee041091a5887289d03f9f1f97cd01149eeb00d4303b76 | serokell/edna | Types.hs | SPDX - FileCopyrightText : 2021 >
--
SPDX - License - Identifier : AGPL-3.0 - or - later
-- | Types that exist specifially for Library API.
module Edna.Library.Web.Types
( TargetResp (..)
, TargetSortingSpec
, CompoundResp (..)
, CompoundSortingSpec
, MethodologyReq (..)
, MethodologyResp (..)
, ... | null | https://raw.githubusercontent.com/serokell/edna/5985c1c8aa5a5c50d7d4468aa3bb4d614525834f/backend/src/Edna/Library/Web/Types.hs | haskell |
| Types that exist specifially for Library API.
| Project as submitted by end users.
| Project as response from server
^ Names of all compounds involved in this project.
does not matter for sorting.
| Test methodology as submitted by end users.
with orphans.
| Test methodology as response from the server.
| T... | SPDX - FileCopyrightText : 2021 >
SPDX - License - Identifier : AGPL-3.0 - or - later
module Edna.Library.Web.Types
( TargetResp (..)
, TargetSortingSpec
, CompoundResp (..)
, CompoundSortingSpec
, MethodologyReq (..)
, MethodologyResp (..)
, MethodologySortingSpec
, ProjectReq (..)
, Project... |
23a38c36445bf7b208439fbd6000141d06a0a8d55d2f9d932bce632ff74c8c11 | hoelzl/Clicc | equal.lisp | ;;;-----------------------------------------------------------------------------
Copyright ( C ) 1993 Christian - Albrechts - Universitaet zu Kiel , Germany
;;;-----------------------------------------------------------------------------
Projekt : APPLY - A Practicable And Portable Lisp Implementation
;;; ... | null | https://raw.githubusercontent.com/hoelzl/Clicc/cea01db35301144967dc74fd2f96dd58aa52d6ea/src/runtime/lisp/equal.lisp | lisp | -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
------------------------------------------------------
$Log: equal.lisp,v $
Revision 1.6 1993/04/22 10:48:21 hk
(in-package "RUNTIME") -> (in-p... | Copyright ( C ) 1993 Christian - Albrechts - Universitaet zu Kiel , Germany
Projekt : APPLY - A Practicable And Portable Lisp Implementation
Funktion : Laufzeitsystem , Funktionen EQUAL , EQUALP
$ Revision : 1.8 $
Revision 1.8 1994/02/02 09:41:32 hk
Deklaration simp - when - some - arg - not - cons ... |
059c41c3c084a802187621788bd3ed85bf8cbb28d90e94508e6ae16ad3fcdfdb | c-cube/funarith | Diophantine.ml | module Fmt = CCFormat
module Vec = CCVector
module type S = Diophantine_intf.S
module Make(Z : Int.DERIVED) = struct
module Z = Z
exception Inconsistent_lengths
let[@inline] is_zero x : bool = Z.equal Z.zero x
module Solution = struct
type t = Z.t array
let pp out (sol:t): unit =
if Array.le... | null | https://raw.githubusercontent.com/c-cube/funarith/1c86ac45e9608efaa761e3f14455402730885339/src/Diophantine.ml | ocaml | length of each sub-array
system [a]
stack of vectors
frozen indices
[i] -> [a · stack.(i)]
temporary array for frozen elements
number of vectors in [stack]
solutions found so far
local allocator to re-use arrays
recycle an array
allocate (or re-use) an array of size [n]
scalar product
[s1 < s2]... | module Fmt = CCFormat
module Vec = CCVector
module type S = Diophantine_intf.S
module Make(Z : Int.DERIVED) = struct
module Z = Z
exception Inconsistent_lengths
let[@inline] is_zero x : bool = Z.equal Z.zero x
module Solution = struct
type t = Z.t array
let pp out (sol:t): unit =
if Array.le... |
e44a2857bd3628296dafede4747f5cc508afe7558c119b0c7320ba41d5eb72a0 | haroldcarr/learn-haskell-coq-ml-etc | hw09.hs |
Created : 2014 Dec 01 ( Mon ) 13:34:38 by .
Last Modified : 2014 Dec 01 ( Mon ) by .
Created : 2014 Dec 01 (Mon) 13:34:38 by Harold Carr.
Last Modified : 2014 Dec 01 (Mon) 16:53:45 by Harold Carr.
-}
# LANGUAGE NPlusKPatterns #
import Data.Char
import Data.List
import ... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/course/2014-10-edx-delft-fp101x-intro-to-fp-erik-meijer/hw09.hs | haskell | HOMEWORK 9
----------------------------------------------------------------------------
EXERCISE 0
n2i7 = \n -> length [c | c <- show n, c == 'S']
----------------------------------------------------------------------------
i2n7 :: Integer -> Nat
---------------------------------------------------------------------... |
Created : 2014 Dec 01 ( Mon ) 13:34:38 by .
Last Modified : 2014 Dec 01 ( Mon ) by .
Created : 2014 Dec 01 (Mon) 13:34:38 by Harold Carr.
Last Modified : 2014 Dec 01 (Mon) 16:53:45 by Harold Carr.
-}
# LANGUAGE NPlusKPatterns #
import Data.Char
import Data.List
import ... |
8aefcc97d0756daf7c0652b989e4ff22486fabc82be0779fd59e39cee9f70f06 | EligiusSantori/L2Apf | change_wait_type.scm | (module system racket/base
(require "../../packet.scm")
(provide game-server-packet/change-wait-type)
(define (game-server-packet/change-wait-type buffer)
(let ((s (open-input-bytes buffer)))
(list
(cons 'id (read-byte s))
(cons 'object-id (read-int32 #f s))
(cons 'sitting? (zero? (read-i... | null | https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/packet/game/server/change_wait_type.scm | scheme | (module system racket/base
(require "../../packet.scm")
(provide game-server-packet/change-wait-type)
(define (game-server-packet/change-wait-type buffer)
(let ((s (open-input-bytes buffer)))
(list
(cons 'id (read-byte s))
(cons 'object-id (read-int32 #f s))
(cons 'sitting? (zero? (read-i... | |
432daa323f50b8b32d587797d232aa6b4e0071bd96ef476b8a540e59cd0c1de3 | exercism/scheme | test.scm | (load "test-util.ss")
(define test-cases
`((test-success "square of sum 1" = square-of-sum '(1) 1) (test-success "square of sum 5" = square-of-sum '(5) 225)
(test-success "square of sum 100" = square-of-sum '(100)
25502500)
(test-success "sum of squares 1" = sum-of-squares '(1) 1)
(test-success... | null | https://raw.githubusercontent.com/exercism/scheme/2064dd5e5d5a03a06417d28c33c5349bec97dad7/exercises/practice/difference-of-squares/test.scm | scheme | (load "test-util.ss")
(define test-cases
`((test-success "square of sum 1" = square-of-sum '(1) 1) (test-success "square of sum 5" = square-of-sum '(5) 225)
(test-success "square of sum 100" = square-of-sum '(100)
25502500)
(test-success "sum of squares 1" = sum-of-squares '(1) 1)
(test-success... | |
ac8ae11992c54a9ec61098ff55fd0de0989b305c5dd56cc4654829a1cda32c9a | apatil/ocaml-vega-lite | gen_utils.ml | (*
Utility to wrap an expression generated with [%expr blah] in a 'description',
which is needed to embed the expression in some P structures.
*)
let expr_of_desc (desc : Parsetree.expression_desc) : Parsetree.expression =
Parsetree.{
pexp_desc = desc;
pexp_loc = Location.none;
pexp_attributes = []
};;
... | null | https://raw.githubusercontent.com/apatil/ocaml-vega-lite/182cbbe134942a2f98c2900fc134071ab6c93479/gen/gen_utils.ml | ocaml |
Utility to wrap an expression generated with [%expr blah] in a 'description',
which is needed to embed the expression in some P structures.
Like expr_of_desc for patterns
Like expr_of_desc for types
Like expr_of_desc for module types
Convert a string to an identifier
Convert a string to a type reference with... | let expr_of_desc (desc : Parsetree.expression_desc) : Parsetree.expression =
Parsetree.{
pexp_desc = desc;
pexp_loc = Location.none;
pexp_attributes = []
};;
let pattern_of_desc (desc : Parsetree.pattern_desc) : Parsetree.pattern =
Parsetree.{
ppat_desc = desc;
ppat_loc = Location.none;
p... |
ead89f75b399c4200e7c22471b967e2795c465ff140a2341ebeebcb0822eb20e | sim642/ppx_viewpattern | both.ml | (** /-/wikis/view-patterns#both-patterns *)
let both x = (x, x)
(* These are a bit silly because you could just use the standard [(h :: t) as xs] pattern. *)
let f_function = function
| [%view? (xs, h :: t) when both] -> h :: xs @ t
[@@@warning "-partial-match"]
let f_fun = fun [%view? (xs, h :: t) when both] ->... | null | https://raw.githubusercontent.com/sim642/ppx_viewpattern/7e9dbad454973e7750c43b6cb96c7bac48edf13a/example/haskell/both.ml | ocaml | * /-/wikis/view-patterns#both-patterns
These are a bit silly because you could just use the standard [(h :: t) as xs] pattern. |
let both x = (x, x)
let f_function = function
| [%view? (xs, h :: t) when both] -> h :: xs @ t
[@@@warning "-partial-match"]
let f_fun = fun [%view? (xs, h :: t) when both] -> h :: xs @ t
This is represented as fun in the AST as well .
let f_param [%view? (xs, h :: t) when both] = h :: xs @ t
let f_let_in l ... |
14dddaa0d1420b566fcf3467c72864f961d5a90aed09a970c3a6779f0fe587fb | cerber/mod_http_upload | gen_mod.erl | %%%----------------------------------------------------------------------
%%% File : gen_mod.erl
Author : < >
%%% Purpose :
%%% Purpose :
Created : 24 Jan 2003 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2015 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
mo... | null | https://raw.githubusercontent.com/cerber/mod_http_upload/7024dbf860bcd3d1c34d066e4aae7708322837d4/ejabberd-dev/src/gen_mod.erl | erlang | ----------------------------------------------------------------------
File : gen_mod.erl
Purpose :
Purpose :
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRA... | Author : < >
Created : 24 Jan 2003 by < >
ejabberd , Copyright ( C ) 2002 - 2015 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
4ee2c97d0b293d5395ee95035cadad32527d008f3ace382cdf620e2457b223c1 | solita/mnt-teet | contract_partners_controller.cljs | (ns teet.contract.contract-partners-controller
(:require [tuck.core :as t]
tuck.effect
[teet.common.common-controller :as common-controller]
[teet.log :as log]
[teet.user.user-model :as user-model]
[teet.ui.format :as format]
[teet.localization :... | null | https://raw.githubusercontent.com/solita/mnt-teet/833bc045d84f4d03fde26dbef41771fd167a2ccf/app/frontend/src/cljs/teet/contract/contract_partners_controller.cljs | clojure | (ns teet.contract.contract-partners-controller
(:require [tuck.core :as t]
tuck.effect
[teet.common.common-controller :as common-controller]
[teet.log :as log]
[teet.user.user-model :as user-model]
[teet.ui.format :as format]
[teet.localization :... | |
b87f876ef22286d95c183145d18e071660a382e747cc3ad248d03b77f6a6a4f9 | rabbitmq/seshat | seshat_counters_server_test.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(seshat_counters_server_test).
-include_li... | null | https://raw.githubusercontent.com/rabbitmq/seshat/bf404ad8ed4a645653f350ad9fc0842b38cafd7f/test/seshat_counters_server_test.erl | erlang | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(seshat_counters_server_test).
-include_lib("eun... | |
267dc1a3954e09e8cafe5fbeaad4a7bbd2e08e5ac60a9b8e21bdaa6231307938 | serokell/qtah | QVBoxLayout.hs | This file is part of Qtah .
--
Copyright 2015 - 2018 The Qtah Authors .
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your option) ... | null | https://raw.githubusercontent.com/serokell/qtah/abb4932248c82dc5c662a20d8f177acbc7cfa722/qtah-generator/src/Graphics/UI/Qtah/Generator/Interface/Widgets/QVBoxLayout.hs | haskell |
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | This file is part of Qtah .
Copyright 2015 - 2018 The Qtah Authors .
the Free Software Foundation , either version 3 of the License , or
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
module Graphics.UI.Qtah.Generator.Interface.Wi... |
5952b7130653b829bb5acb8401895998bade90b167a92a42eb7245fefa357963 | cndreisbach/clojure-web-dev-workshop | handler.clj | (ns we-owe.handler
(:require [clojure.pprint :refer [pprint]]
[compojure.core :refer :all]
[compojure.route :as route]
[compojure.handler :as handler]
[we-owe.views :as views]))
(defn create-routes [db]
(routes
(GET "/" [] (views/index-page db))
(GET "/:person"... | null | https://raw.githubusercontent.com/cndreisbach/clojure-web-dev-workshop/95d9fdf94b39f8a1e408b8bf75a81b92899ee7d9/code/02-compojure/src/we_owe/handler.clj | clojure | (ns we-owe.handler
(:require [clojure.pprint :refer [pprint]]
[compojure.core :refer :all]
[compojure.route :as route]
[compojure.handler :as handler]
[we-owe.views :as views]))
(defn create-routes [db]
(routes
(GET "/" [] (views/index-page db))
(GET "/:person"... | |
bb59efddcfd0eae22d114f01b01887ac2bb4626881033986d5f2446bd40982a7 | jaked/ooauth | oauth_netclient_http_client.ml | let request
?(http_method = `Post)
~url
?(headers = [])
?(params = [])
?body
() =
let call =
match http_method, body with
| `Post, None ->
new Http_client.post url params
| `Post, Some (content_type, body) ->
let query = Netencoding.Url.mk_url_encoded_parame... | null | https://raw.githubusercontent.com/jaked/ooauth/8fa9d19570c7c5dea1036b5e9f5bbd945e51166d/oauth_netclient_http_client.ml | ocaml | let request
?(http_method = `Post)
~url
?(headers = [])
?(params = [])
?body
() =
let call =
match http_method, body with
| `Post, None ->
new Http_client.post url params
| `Post, Some (content_type, body) ->
let query = Netencoding.Url.mk_url_encoded_parame... | |
e29da5fce30eef2c77492313bcac331a3833d69c031042c8ee7212ce11f55aa3 | slindley/effect-handlers | FreeHandlerIx.hs | {- Handler for indexed types using a free monad -}
# LANGUAGE
GADTs ,
TypeFamilies ,
MultiParamTypeClasses ,
FlexibleInstances ,
FlexibleContexts ,
TypeOperators ,
PolyKinds , DataKinds , RankNTypes , ScopedTypeVariables
#
GADTs,
TypeFamilies,
MultiParamTypeCla... | null | https://raw.githubusercontent.com/slindley/effect-handlers/39d0d09582d198dd6210177a0896db55d92529f4/ix/FreeHandlerIx.hs | haskell | Handler for indexed types using a free monad
Example from Kleisli arrows of outrageous fortune |
# LANGUAGE
GADTs ,
TypeFamilies ,
MultiParamTypeClasses ,
FlexibleInstances ,
FlexibleContexts ,
TypeOperators ,
PolyKinds , DataKinds , RankNTypes , ScopedTypeVariables
#
GADTs,
TypeFamilies,
MultiParamTypeClasses,
FlexibleInstances,
FlexibleContexts,
... |
de411b6c53687e2da7c6ddfc3f38feb2d9ceba80540a7b6be718cba1ca5165e8 | Mushy-pea/Game-Dangerous | EncodeStatus.hs | Game : : Dangerous code by . You are free to use this software and view its source code .
-- If you wish to redistribute it or use it as part of your own work, this is permitted as long as you acknowledge the work is by the abovementioned author.
The functions in this module are part of the system that handles... | null | https://raw.githubusercontent.com/Mushy-pea/Game-Dangerous/f77bb6b9606dc326e89ab5b91abec978b0018898/src/EncodeStatus.hs | haskell | If you wish to redistribute it or use it as part of your own work, this is permitted as long as you acknowledge the work is by the abovementioned author.
being set outside of their valid range are rejected. This approach has been taken to avoid adding complexity to the per map game state saving system.
They are use... | Game : : Dangerous code by . You are free to use this software and view its source code .
The functions in this module are part of the system that handles progression between maps . Upon reaching the transition point between two maps
the user is presented with a 32 hex digit level unlock code , within whic... |
feb0d8ef9f03030ec74dd33c0636db3139401d19da72e89857d608193ef501d6 | donatello/minio-hs-archived | listIncompleteParts.hs | #!/usr/bin/env stack
stack --resolver runghc --package minio - hs
{-# Language OverloadedStrings #-}
import Network.Minio
import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as CC
import Data.Default (Default(..))
import Prelude
| The following example use... | null | https://raw.githubusercontent.com/donatello/minio-hs-archived/c808dc1be2a5b15c2c714c0052f1d6a7bc98a809/examples/listIncompleteParts.hs | haskell | resolver runghc --package minio - hs
# Language OverloadedStrings #
:9000. The endpoint and associated
| #!/usr/bin/env stack
import Network.Minio
import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as CC
import Data.Default (Default(..))
import Prelude
| The following example uses 's play server at
credentials are provided via the libary constant ,
> minio... |
26d8fd39951dea3ffe922e2388b387a58ae3911d3052cb2755ede5dfeda723a1 | ddssff/refact-global-hse | Utils.hs | # LANGUAGE CPP #
{-# LANGUAGE PackageImports #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts , FlexibleInstances , RankNTypes , ScopedTypeVariables #
module Utils where
import Control.Exception (SomeException, throw)
import ... | null | https://raw.githubusercontent.com/ddssff/refact-global-hse/519a017009cae8aa1a3db1b46eb560d76bd9895d/tests/expected/decl5/Utils.hs | haskell | # LANGUAGE PackageImports #
import Data.Bool (bool)
| Do a hard reset of all the files of the repository containing the
working directory.
| Do a hard reset of all the files of a subdirectory within a git
repository. (Does this every throw an exception?)
| Determine whether the repository containing the working d... | # LANGUAGE CPP #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts , FlexibleInstances , RankNTypes , ScopedTypeVariables #
module Utils where
import Control.Exception (SomeException, throw)
import Control.Exception.Lifted as IO (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.