BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Haskell Gets iOS Support, Several language and Performance Improvements

by Roopesh Shenoy on Apr 16, 2014 |

GHC 7.8.1 was recently released, bringing several improvements to the Haskell ecosystem. Haskell can now be compiled for iOS, and sports new features such as Closed Type Families, Roles, Overloaded Lists, Pattern Synonyms as well as several performance improvements.

Haskell can be compiled for iOS via clang. This supports development using XCode 5. Due to the lack of cross-platform GUI libraries in Haskell, for now you need to develop the GUI separately in objectiveC and invoke Haskell functions from your GUI code. While this support was announced around 7 months back, this is the first major GHC release to include this support.

Note that Template Haskell is not available on iOS yet.

The cross-platform compilation story has also improved in general. For example, dynamic linking is supported better. GHCi (interactive) now uses the system dynamic linker by default, instead of the built-in static linker. With GHC, you can use a new compilation flag "--dynamic-too", to emit both static and dynamic object files at the same time. (by default GHC still uses static linking).

Some other features introduced in this release -

  • Closed Type Families - type families are used for overloading of data types. A closed family type has all of its equations defined in one place and cannot be extended - this is useful to avoid consequences not intended by the original developer.
  • Roles - to eliminate type unsafe definitions when using GeneralizedNewTypeDeriving
  • Overloaded Lists - Sugar to use list notations for construction of structures such as Set, Map, IntMap, Vector, Text and Array
  • Pattern Synonyms
  • Typeable is now poly-kinded, making Typeable1, Typeable2, etc. obsolete and deprecated.
  • Brand new I/O manager that scales linearly upto 32 cores
  • Several improvements to Template Haskell, such as support for Roles, annotation pragmas, "Typed Template Haskell expressions"
  • Parallel mode for make
  • Improved solver for type naturals (performance improvement)

A potentially breaking change coming in the next release (7.10) is that Applicative will be a super-class of Monad. To help ease the transition, the current version of GHC will emit a warning if - a type is an instance of Monad but not Applicative, MonadPlus but not Alternative, and when a local function named join, <*> or pure is defined.

There are also several other changes - you can refer the release notes for the full list.

Note that the Haskell Platform, which bundles GHC and tools to work with Haskell, has not yet been updated to use the latest version of GHC. 

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT