Write isSorted, which checks whether an Array[A] is sorted
according to a given comparison function cmp(A,A) => Boolean.
The comparison function must evaluate to true for successive elements of the array.
| documentclass | extarticle |
|---|---|
| fontsize | 9pt |
When using developPackage in a default.nix, you may need to depend on Haskell libraries that aren't in nixpkgs — either from a personal GitHub repo or from your local filesystem. Both cases follow the same pattern: override haskellPackages with a custom overrides function and use callCabal2nix to build the package from source.
Use fetchFromGitHub to pull the source and callCabal2nix to build it:
let| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE StandaloneDeriving #-} | |
| import qualified Data.Vector.Generic as G | |
| import qualified Data.Vector.Generic.Mutable as M | |
| import qualified Data.Vector.Unboxed as U | |
| import Data.Word (Word64) |