Skip to content

Commit

Permalink
Merge pull request #24 from CodaFi/swift-1-dot-2
Browse files Browse the repository at this point in the history
[WIP] Swift 1.2
  • Loading branch information
CodaFi committed May 8, 2015
2 parents d05a455 + c51b90a commit a9facba
Show file tree
Hide file tree
Showing 39 changed files with 276 additions and 695 deletions.
10 changes: 2 additions & 8 deletions Basis-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
84922CE419D237DA00AE9A7C /* Arrow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84922CB219D237DA00AE9A7C /* Arrow.swift */; };
84922CE519D237DA00AE9A7C /* BASERealWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = 84922CB319D237DA00AE9A7C /* BASERealWorld.h */; settings = {ATTRIBUTES = (Public, ); }; };
84922CE619D237DA00AE9A7C /* BASERealWorld.m in Sources */ = {isa = PBXBuildFile; fileRef = 84922CB419D237DA00AE9A7C /* BASERealWorld.m */; };
84922CE719D237DA00AE9A7C /* Basis-ObjCBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 84922CB519D237DA00AE9A7C /* Basis-ObjCBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
84922CE819D237DA00AE9A7C /* Basis.h in Headers */ = {isa = PBXBuildFile; fileRef = 84922CB619D237DA00AE9A7C /* Basis.h */; settings = {ATTRIBUTES = (Public, ); }; };
84922CE919D237DA00AE9A7C /* Bottom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84922CB719D237DA00AE9A7C /* Bottom.swift */; };
84922CEA19D237DA00AE9A7C /* Bounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84922CB819D237DA00AE9A7C /* Bounded.swift */; };
Expand Down Expand Up @@ -87,7 +86,6 @@
84D77DF61A3BE573000F5683 /* Pointed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D77DF51A3BE573000F5683 /* Pointed.swift */; };
84D77DFB1A3CF9FA000F5683 /* ListSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D77DFA1A3CF9FA000F5683 /* ListSpec.swift */; };
84F43F0119E1B3B40012CF95 /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F43F0019E1B3B40012CF95 /* Optional.swift */; };
84F43F0519E1CA970012CF95 /* Set.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F43F0419E1CA970012CF95 /* Set.swift */; };
84F9063019D639980035D429 /* CompareSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F9062F19D639980035D429 /* CompareSpec.swift */; };
84F9071519D64DE10035D429 /* ScansSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F9071419D64DE10035D429 /* ScansSpec.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -145,7 +143,6 @@
84922CB219D237DA00AE9A7C /* Arrow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Arrow.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84922CB319D237DA00AE9A7C /* BASERealWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BASERealWorld.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
84922CB419D237DA00AE9A7C /* BASERealWorld.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BASERealWorld.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
84922CB519D237DA00AE9A7C /* Basis-ObjCBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "Basis-ObjCBridge.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
84922CB619D237DA00AE9A7C /* Basis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Basis.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
84922CB719D237DA00AE9A7C /* Bottom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Bottom.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84922CB819D237DA00AE9A7C /* Bounded.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Bounded.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
Expand Down Expand Up @@ -189,7 +186,6 @@
84D77DF51A3BE573000F5683 /* Pointed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pointed.swift; sourceTree = "<group>"; };
84D77DFA1A3CF9FA000F5683 /* ListSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ListSpec.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84F43F0019E1B3B40012CF95 /* Optional.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Optional.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84F43F0419E1CA970012CF95 /* Set.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Set.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84F9062F19D639980035D429 /* CompareSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompareSpec.swift; sourceTree = "<group>"; };
84F9071419D64DE10035D429 /* ScansSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScansSpec.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -302,7 +298,6 @@
children = (
84922CB319D237DA00AE9A7C /* BASERealWorld.h */,
84922CB419D237DA00AE9A7C /* BASERealWorld.m */,
84922CB519D237DA00AE9A7C /* Basis-ObjCBridge.h */,
84922CC719D237DA00AE9A7C /* Info.plist */,
);
name = "Supporting Files";
Expand Down Expand Up @@ -384,7 +379,6 @@
84F43F0019E1B3B40012CF95 /* Optional.swift */,
84922CD419D237DA00AE9A7C /* Monoid.swift */,
84922EB219D386BD00AE9A7C /* Result.swift */,
84F43F0419E1CA970012CF95 /* Set.swift */,
84D77DF71A3BE57B000F5683 /* Pointed */,
84922CD919D237DA00AE9A7C /* ST.swift */,
84922CDA19D237DA00AE9A7C /* STRef.swift */,
Expand Down Expand Up @@ -432,7 +426,6 @@
buildActionMask = 2147483647;
files = (
84922CE819D237DA00AE9A7C /* Basis.h in Headers */,
84922CE719D237DA00AE9A7C /* Basis-ObjCBridge.h in Headers */,
84922CE519D237DA00AE9A7C /* BASERealWorld.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -574,7 +567,6 @@
84922D0119D237DA00AE9A7C /* Map.swift in Sources */,
84D4D8E81A16EBAF001F5E4D /* Comonad.swift in Sources */,
84922D1219D237DA00AE9A7C /* Tuple.swift in Sources */,
84F43F0519E1CA970012CF95 /* Set.swift in Sources */,
84922CE619D237DA00AE9A7C /* BASERealWorld.m in Sources */,
84922CFC19D237DA00AE9A7C /* Kinds.swift in Sources */,
84922CF319D237DA00AE9A7C /* Exit.swift in Sources */,
Expand Down Expand Up @@ -723,6 +715,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
Expand All @@ -741,6 +734,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_BRIDGING_HEADER = "";
};
name = Release;
Expand Down
10 changes: 4 additions & 6 deletions Basis.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
84922D4819D237E000AE9A7C /* Arrow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84922D1619D237E000AE9A7C /* Arrow.swift */; };
84922D4919D237E000AE9A7C /* BASERealWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = 84922D1719D237E000AE9A7C /* BASERealWorld.h */; settings = {ATTRIBUTES = (Public, ); }; };
84922D4A19D237E000AE9A7C /* BASERealWorld.m in Sources */ = {isa = PBXBuildFile; fileRef = 84922D1819D237E000AE9A7C /* BASERealWorld.m */; };
84922D4B19D237E000AE9A7C /* Basis-ObjCBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 84922D1919D237E000AE9A7C /* Basis-ObjCBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
84922D4C19D237E000AE9A7C /* Basis.h in Headers */ = {isa = PBXBuildFile; fileRef = 84922D1A19D237E000AE9A7C /* Basis.h */; settings = {ATTRIBUTES = (Public, ); }; };
84922D4D19D237E000AE9A7C /* Bottom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84922D1B19D237E000AE9A7C /* Bottom.swift */; };
84922D4E19D237E000AE9A7C /* Bounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84922D1C19D237E000AE9A7C /* Bounded.swift */; };
Expand Down Expand Up @@ -153,7 +152,6 @@
84922D1619D237E000AE9A7C /* Arrow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Arrow.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84922D1719D237E000AE9A7C /* BASERealWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BASERealWorld.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
84922D1819D237E000AE9A7C /* BASERealWorld.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BASERealWorld.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
84922D1919D237E000AE9A7C /* Basis-ObjCBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "Basis-ObjCBridge.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
84922D1A19D237E000AE9A7C /* Basis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Basis.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
84922D1B19D237E000AE9A7C /* Bottom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Bottom.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
84922D1C19D237E000AE9A7C /* Bounded.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Bounded.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
Expand Down Expand Up @@ -281,7 +279,6 @@
children = (
84922D1719D237E000AE9A7C /* BASERealWorld.h */,
84922D1819D237E000AE9A7C /* BASERealWorld.m */,
84922D1919D237E000AE9A7C /* Basis-ObjCBridge.h */,
84922D2B19D237E000AE9A7C /* Info.plist */,
);
name = "Supporting Files";
Expand Down Expand Up @@ -332,7 +329,6 @@
84922D3819D237E000AE9A7C /* Monoid.swift */,
84922EB019D3869B00AE9A7C /* Result.swift */,
84D77DF41A3BDCBA000F5683 /* Pointed */,
842963B119DF7A3A003FCBE8 /* Set.swift */,
84922D3D19D237E000AE9A7C /* ST.swift */,
842A315D1A9982FD00039306 /* State.swift */,
84922D3E19D237E000AE9A7C /* STRef.swift */,
Expand Down Expand Up @@ -447,7 +443,6 @@
buildActionMask = 2147483647;
files = (
84922D4C19D237E000AE9A7C /* Basis.h in Headers */,
84922D4B19D237E000AE9A7C /* Basis-ObjCBridge.h in Headers */,
84922D4919D237E000AE9A7C /* BASERealWorld.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -591,7 +586,6 @@
841FE04419DB7E7C0068636A /* Transformations.swift in Sources */,
84922D5A19D237E000AE9A7C /* Function.swift in Sources */,
84922D6519D237E000AE9A7C /* Map.swift in Sources */,
842963B219DF7A3A003FCBE8 /* Set.swift in Sources */,
84922D7619D237E000AE9A7C /* Tuple.swift in Sources */,
84922D4A19D237E000AE9A7C /* BASERealWorld.m in Sources */,
84922D6019D237E000AE9A7C /* Kinds.swift in Sources */,
Expand Down Expand Up @@ -747,7 +741,9 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "Basis-Swift.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
Expand All @@ -767,7 +763,9 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "Basis-Swift.h";
};
name = Release;
};
Expand Down
35 changes: 23 additions & 12 deletions Basis/Applicative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
// Released under the MIT license.
//

/// Applicative sits in the middle distance between a Functor and a Monad. An Applicative Functor
/// is a Functor equipped with a function (called point or lift) that takes a value to an instance
/// of a functor containing that value. Applicative Functors provide the ability to operate on not
/// just values, but values in a functorial context such as Eithers, Lists, and Optionals without
/// needing to unwrap or map over their contents.
/// Applicative sits in the middle distance between a Functor and a Monad.
///
/// Applicative Functors, as the name implies, allow for the application of functions inside of
/// Functors. In this way Applicative Functors provide the ability to operate on not just values,
/// but values in a functorial context such as Eithers, Lists, and Optionals without needing to
/// unwrap or map over their contents.
public protocol Applicative : Pointed, Functor {
/// Type of Functors containing morphisms from our objects to a target.
typealias FAB = K1<A -> B>

class func ap(FAB) -> Self -> FB
static func ap(FAB) -> Self -> FB

/// Sequential Application | Applies the function "inside the Functor" to the "inside" of our
/// Functor and herds up the results.
Expand All @@ -26,21 +27,24 @@ public protocol Applicative : Pointed, Functor {
/// the right.
///
/// Default definition:
/// `const(id) <%> a <*> b`
///
/// const(id) <%> a <*> b
func *>(Self, FB) -> FB

/// Sequence Left | Disregards the Functor on the Right.
///
/// Default definition:
/// `const <%> a <*> b`
///
/// const <%> a <*> b
func <*(Self, FB) -> Self
}

/// Alternatives are Applicative Monoids.
public protocol Alternative : Applicative {
/// The type of the result of Alternative's mappend-esque functions.
typealias FLA = K1<[A]>

typealias FMA = K1<Maybe<A>>

/// Returns the identity element.
func empty() -> Self

Expand All @@ -62,6 +66,13 @@ public protocol Alternative : Applicative {
///
/// some(v) <|> pure([])
func many(Self) -> FLA

/// One or none
///
/// Default definition:
///
/// `Maybe.just <%> v <|> pure(Maybe.nothing())`
func optional(Self) -> FMA
}

/// Additional functions to be implemented by those types conforming to the Applicative protocol.
Expand All @@ -72,11 +83,11 @@ public protocol ApplicativeOps : Applicative {
typealias FD = K1<D>

/// Lift a function to a Functorial action.
class func liftA(f : A -> B) -> Self -> FB
static func liftA(f : A -> B) -> Self -> FB

/// Lift a binary function to a Functorial action.
class func liftA2(f : A -> B -> C) -> Self -> FB -> FC
static func liftA2(f : A -> B -> C) -> Self -> FB -> FC

/// Lift a ternary function to a Functorial action.
class func liftA3(f : A -> B -> C -> D) -> Self -> FB -> FC -> FD
static func liftA3(f : A -> B -> C -> D) -> Self -> FB -> FC -> FD
}
14 changes: 7 additions & 7 deletions Basis/Arrow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public protocol Arrow : Category {
typealias FANOUT = K2<B, (B, D)>

/// Lift a function to an arrow.
class func arr(A -> B) -> Self
static func arr(A -> B) -> Self

/// Splits the arrow into two tuples that model a computation that applies our Arrow to an
/// argument on the "left side" and sends the "right side" through unchanged.
Expand Down Expand Up @@ -96,7 +96,7 @@ public protocol ArrowZero : Arrow {
typealias ABC = K2<A, B>

/// The identity arrow.
class func zeroArrow() -> ABC
static func zeroArrow() -> ABC
}

/// A monoid for Arrows.
Expand Down Expand Up @@ -147,10 +147,10 @@ public protocol ArrowChoice : Arrow {

/// Feed marked inputs through the argument arrow, passing the rest through unchanged to the
/// output.
class func left(Self) -> LEFT
static func left(Self) -> LEFT

/// The mirror image of left.
class func right(Self) -> RIGHT
static func right(Self) -> RIGHT

/// Splat | Split the input between both argument arrows, then retag and merge their outputs
/// into Eithers.
Expand All @@ -167,11 +167,11 @@ public protocol ArrowChoice : Arrow {
/// \
/// o - a - [ f ] -> b
/// /
/// a -------> a - •
/// a ------------ •
///
public protocol ArrowApply : Arrow {
typealias APP = K2<(Self, A), B>
class func app() -> APP
static func app() -> APP
}

/// Arrows that admit right-tightening recursion.
Expand All @@ -188,5 +188,5 @@ public protocol ArrowApply : Arrow {
public protocol ArrowLoop : Arrow {
typealias LOOP = K2<(A, D), (B, D)>

class func loop(LOOP) -> Self
static func loop(LOOP) -> Self
}
15 changes: 0 additions & 15 deletions Basis/Basis-ObjCBridge.h

This file was deleted.

9 changes: 8 additions & 1 deletion Basis/Bottom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@
// Released under the MIT license.
//

/// The type from which no information may be drawn.
/// The type from which no information may be drawn and no instances may be made. Bottom (also
/// notated ⊥) is the type of all computations that never complete successfully and is inhabited by
/// infinite loops and fatal errors.
public enum Bottom { }

/// Computes ⊥.
public func absurd() -> Bottom {
return absurd()
}
6 changes: 3 additions & 3 deletions Basis/Bounded.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
/// Bounded types are types that have definable upper and lower limits. For types like the Int and
/// Float, their limits are the minimum and maximum possible values representable in their bit-
/// width. While the definition of a "limit" is flexible, generally custom types that wish to
/// appear bounded must come with some kind of supremum or infimum.
/// appear bounded must come with some kind of supremum and infimum.
public protocol Bounded {
class func minBound() -> Self
class func maxBound() -> Self
static func minBound() -> Self
static func maxBound() -> Self
}

extension Bool : Bounded {
Expand Down
9 changes: 4 additions & 5 deletions Basis/Category.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
/// between those objects. Each object includes an identity morphism, and composition of morphisms
/// is the primary reason categories are such powerful abstractions.
///
/// Here, a Category is some class of Kind * -> * -> * that you can think of as modelling an "arrow"
/// from A -> B. This means that if we provide a composition function, `•`, we can hook up
/// Categories from A -> B with Categories from B -> C and get Categories from A -> C. This
/// function is also called >>>.
/// Here, a Category is some class of Kind `* -> * -> *` that you can think of as modelling an "arrow"
/// A -> B. This means that if we provide a composition function, `•`, we can hook up Categories
/// from A -> B with Categories from B -> C and get Categories from A -> C.
public protocol Category {
/// Source
typealias A
Expand All @@ -31,7 +30,7 @@ public protocol Category {
typealias CAC = K2<A, C>

/// The identity morphism.
class func id() -> CAA
static func id() -> CAA

/// Composition of categories.
///
Expand Down
2 changes: 1 addition & 1 deletion Basis/Coerce.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// The highly unsafe primitive unsafeCoerce converts a value from any type to any other type.
/// Needless to say, if you use this function, it is your responsibility to ensure that the old and
/// new types have identical internal representations, in order to prevent runtime corruption.
/// ~http://hackage.haskell.org/package/base-4.7.0.1/docs/Unsafe-Coerce.html
/// ~( http://hackage.haskell.org/package/base-4.7.0.1/docs/Unsafe-Coerce.html )
public func unsafeCoerce<A, B>(x : A) -> B {
return unsafeBitCast(x, B.self)
}
Loading

0 comments on commit a9facba

Please sign in to comment.