Difference between revisions of "Diagrams/Dev/Migrate1.4"

From HaskellWiki
< Diagrams‎ | Dev
Jump to: navigation, search
(Create 1.4 migration page: start with snugBL etc.)
 
(1.4 migration: moved Query functions)
 
Line 6: Line 6:
   
 
The <code>snugBL</code>, <code>snugBR</code>, <code>snugTR</code> and <code>snugBR</code> functions have been deprecated, since they were unintuitive, ad-hoc, and not particularly useful, especially since e.g. <code>snugL</code> and <code>snugB</code> do not commute (so in theory <code>snugBL</code> and <code>snugLB</code> would be different). If you were using these functions, you can switch to using a composition like <code>snugB . snugL</code> directly, or use <code>snug</code> with a direction vector. See the discussion at [https://github.com/diagrams/diagrams-lib/issues/250 diagrams-lib issue #250] for more details.
 
The <code>snugBL</code>, <code>snugBR</code>, <code>snugTR</code> and <code>snugBR</code> functions have been deprecated, since they were unintuitive, ad-hoc, and not particularly useful, especially since e.g. <code>snugL</code> and <code>snugB</code> do not commute (so in theory <code>snugBL</code> and <code>snugLB</code> would be different). If you were using these functions, you can switch to using a composition like <code>snugB . snugL</code> directly, or use <code>snug</code> with a direction vector. See the discussion at [https://github.com/diagrams/diagrams-lib/issues/250 diagrams-lib issue #250] for more details.
  +
  +
== Moved Query functions ==
  +
  +
Some <code>Query</code>-related functions (<code>sample</code>, <code>value</code>, <code>resetValue</code>, and <code>clearValue</code>) have moved from the <code>diagrams-core</code> package to the <code>diagrams-lib</code> package; they can now be found in the <code>Diagrams.Query</code> module. You may have to change an import if you were importing them directly from <code>Diagrams.Core.Types</code> before. However, most likely you would get them just by importing <code>Diagrams.Prelude</code>, in which case no changes are necessary.

Latest revision as of 19:52, 16 October 2016

This page describes breaking API changes between diagrams 1.3 and 1.4, along with explanations of how to migrate to the new 1.4 API.

The 1.4 release is actually quite light on breaking API changes; most of the changes were additions and bug fixes. Below are the things we are aware of; feel free to add new things below, or create an issue if you are unsure.

Snugs

The snugBL, snugBR, snugTR and snugBR functions have been deprecated, since they were unintuitive, ad-hoc, and not particularly useful, especially since e.g. snugL and snugB do not commute (so in theory snugBL and snugLB would be different). If you were using these functions, you can switch to using a composition like snugB . snugL directly, or use snug with a direction vector. See the discussion at diagrams-lib issue #250 for more details.

Moved Query functions

Some Query-related functions (sample, value, resetValue, and clearValue) have moved from the diagrams-core package to the diagrams-lib package; they can now be found in the Diagrams.Query module. You may have to change an import if you were importing them directly from Diagrams.Core.Types before. However, most likely you would get them just by importing Diagrams.Prelude, in which case no changes are necessary.