A toy version of Safe Haskell

The idea of Safe Haskell is to control unsafe operations. Here is an alternative idea of implementation. Define a class

> {-# LANGUAGE FlexibleContexts, Rank2Types #-}
> class Unsafe a where

The “a” parameter is unneccessary, but it is required by GHC.

Add the unsafe constraint to each operation.

> unsafePerformIO :: Unsafe () => IO a -> a
> unsafePerformIO = undefined -- implementation skipped

> unsafeCoerce :: Unsafe () => a -> b
> unsafeCoerce = undefined

That’s it. You can now code with unsafe functions. The constraint “Unsafe” is contagious: everything that internally uses unsafe* will be tagged. Old code does not have to be changed except type signatures.

The compiler only has to prohibit users from defining instance Unsafe (). If you do this, you are releasing the brakes, and back to normal Unsafe Haskell.

Safe Haskell has “trustworthy” modules, which can use unsafe features, but their authors claim their interfaces are safe.

This idea can be implemented if there was a special function allowed in trustworthy modules removing the constraint:

> unsafe :: forall a. (Unsafe () => a) -> a
> unsafe = undefined

Of course this falls short of real Safe Haskell, which must forbid Template Haskell, overlapping instances etc. I like the fact that unsafeness of unsafePerformIO is expressed in its type.


I hope this demonstrates zero-parameter type classes might be something reasonable. For now, you can simulate them with -XConstraintKinds and -XDataKinds:

{-# LANGUAGE ConstraintKinds, KindSignatures, DataKinds #-}
class Unsafe' (a :: ())
type Unsafe = Unsafe' '()

Edit:

I just realized you can have unsafe instances:

instance (Unsafe (), Show a) => Show (IORef a) where                          
show = show . unsafePerformIO . readIORef

Continua a leggere

Pubblicato in Senza categoria

All You Need To Know About Kitchen Sinks

With so many shapes, sizes, colours, and materials, one may not be enough.

In its most basic form, the kitchen sink is still what it always has been: a watertight basin where dishware, food, and even small children are washed. Manufacturers, however, are turning this mundane kitchen fixture into something that’s both more stylish and more functional. By experimenting with new shapes, materials, and features, designers are elevating the sink’s status from overlooked to centre stage.
Consumers are increasingly encouraged to see their kitchen sinks as workstations, not just as places to scrub pots and pans. Accessories such as cutting boards, colanders, and knife racks are helping to make sinks more useful even as a broader palette of materials is jazzing them up.
Stainless steel is still the choice of as many as 75% of all buyers. Yet offerings go far beyond traditional one- or two-bowl sinks to encompass large workstations that resemble cleaning and food- prep areas found in commercial kitchens. As sinks keep pace with the commercial-style appliances that many homeowners are installing, prices have risen accordingly.
The rest of the market offers an expanding array of choices, including enamel, solid surface, soapstone, copper, bronze, stone composites, and concrete.
STAINLESS STEEL: MYRIAD SHAPES AND SIZES
It’s easy to understand why professional cooks favour sinks made of stainless steel: It neither absorbs food and bacteria nor rusts, and it is extremely durable, impervious to heat, and relatively easy to clean. Available in both polished and brushed finishes (polished versions are more difficult to maintain), stainless-steel sinks come in a variety of shapes and sizes with as many as three separate bowls.
This economy model is made from thin steel—typically 20 to 22 gauge (ga.)—that is more likely to flex under pressure or dent when something heavy is dropped in the sink. When looking at steel thickness, remember: the higher the gauge, the thinner the steel. In less-expensive sinks, the bowls can be as shallow as 6 in., and deeply rounded inside corners can reduce the amount of usable room in the bottom of the bowl for washing.
The basic, no-frills, one-basin stainless- steel sink (left) still gets the job done—if it’s made of an 18-ga. or thicker steel and has a sufficient depth. The two-bowl model maximizes its area with tight corners.
Stainless steel is still the choice of as many as 75% of all buyers.
Stainless-steel sinks come with virtually any bell or whistle you can imagine.
Although sinks come in as many sizes as they do colours and materials, the de facto American benchmark is a 33-in. by 22-in. two-bowl design. It fits right into a standard 36-in. sink cabinet.
That’s not the biggest sink you can buy, but it should be adequate for most kitchens. Some sinks come with equally sized bowls, but he suggests two different sizes: one 10-in.-deep bowl big enough to handle a broiler pan or cookie sheet, and one smaller, shallower bowl used for washing vegetables and equipped with a waste disposer. “Although manufacturers have created three-bowl sinks, most people find no reason to have that third bowl. It’s more sink than you’re really going to need.”
How big should the sink be?
The key is getting a big pan all the way into the bottom of the larger bowl to avoid washing one end of it and turning it around to wash the other. Measure the largest pan you’re likely to wash in the sink, then choose a bowl that will handle it. Remember that thick outside walls afford less interior room than thinner ones. A stainless-steel sink has more usable room than a cast-iron sink, for example.
Smaller one-basin sinks (25 in. by 22 in.) may work better in a small kitchen, but the design is less flexible. One activity at a time is the rule, and a 10-in. bowl suit- able for scrubbing pots and pans may be difficult to peel and wash vegetables in.
Kitchens where two people work at the same time may benefit from a large two- bowl sink and a smaller prep sink. This option makes sense, says Krengel, when there’s enough room to handle two work areas, and only when both sinks have waste disposers. Otherwise, whoever ends up trimming and washing vegetables at the prep sink has to walk across the room to get rid of the waste, negating the convenience of a second sink.





STAINLESS STEEL: CONTINUED
It looks like it belongs in a professional’s kitchen. Commercial style appliances are a trend in the kitchen, from ranges and refrigerators to sinks.
Moderately priced stainless sinks are made from thicker-gauge steel—up to 18 ga.—and have deeper bowls with more tightly radiuses corners. Bowl depths of 10 in. are common, and because the steel is thicker, it is less susceptible to dent- ing and is quieter when a waste disposer is added. At the very top of the heap are commercial-style sinks made from even heavier 16-ga. steel. These sinks are very stiff and dent-resistant, and extra attention to sound-deadening material on the bottom makes them quieter and better insulated than low-end models.
A trend toward commercial-style appliances is pushing manufacturers to offer stainless-steel work stations that include sinks, cutting boards, integral drain boards, and the like. You’ll pay for what you’re getting, though.
PROS
Durable, nonstaining, and heat-resistant surface; wide variety of shapes and sizes; compatible with a wide range of countertop materials.
CONS
Economy sinks have shallow bowls with thin walls, which are noisy and flexible. Mirror-polished finishes may be troublesome to maintain. Commercial-grade sinks are relatively expensive.
COPPER AND BRONZE: EXOTIC CHOICES THAT DRAW THE EYE
Bronze and copper sinks have a more rustic, less polished look than stainless steel, with a lot of tactile and visual appeal. aesthetically pleasing with great tactile appeal; surface won’t chip or rust.
Limited styles and bowl designs; very high cost; copper will need occasional polishing.
Copper and bronze sinks certainly are pretty to look at, but before you reach into your wallet to pay for one, be sure you’re ready for the scrubbing it will take to keep it looking its best.
PROS
Highly durable non-ferrous metals are aesthetically pleasing with great tactile appeal; surface won’t chip or rust.
CONS
Limited styles and bowl designs; very high cost; copper will need occasional polishing.
SOLID SURFACE: HIGH PERFORMANCE AND FLEXIBLE DESIGN
Sinks made from the same solid-surface materials used for countertops have an ad-vantage over everything else on the market: a seamless installation. Although self-rimming designs are available, the usual approach is to glue the sink to the bottom of the countertop, eliminating the recesses and seams where food and grime can collect. In the hands of a good fabricator, seams are invisible. Although solid-surface sinks aren’t cheap—a 33-in. Double bowl sink are dependable performers. Made from acrylic or polyester resin with a mineral filler, they’re highly stain resistant and nonporous. The pattern or colour (and there are plenty to choose from) goes all the way through, so any surface nicks or dings won’t expose a different substrate below. Solid-surface sinks are more forgiving than cast iron or stone, and they can be scrubbed hard with a Scotch-Brite pad without damaging the surface. Minor blemishes can be sanded out, and major dings can be repaired by a pro.
Solid-surface sinks are available in a variety of shapes and sizes, enough to satisfy most demands. Bowls of different sizes and depths can be bought separately and combined in the same countertop, allowing great design
flexibility. A skilled fabricator can cut apart solid-surface sinks and reform them into different shapes. Reliable ad-hesives make these hybrids leak-free with seams all but invisible. If there is a downside to solid surface, other than cost, it’s that the material may be hard to combine aesthetically with a full range of countertop materials. A solid-surface sink might look out of place with a natural-stone counter, for example, whereas an enamelled cast-iron or stainless-steel sink would not.
Solid-surface sinks mean seamless installations. In-stead of sitting atop the counter like the majority of sinks, a solid-surface sink is glued to the underside of the counter. The fabricator then uses a router to smooth the invisible seam between sink and counter.
PROS
Durable, nonporous, and repairable, with colours or patterns that go all the way through; good sound-deadening qualities; sinks can be glued into solid-surface counters for seamless connection.
CONS
Can be relatively expensive and may not be aesthetically suit- able with all counter- top materials.
Drop-in or undermount
Good: SELF-RIMMING
Self-rimming sinks drop into a hole cut in the countertop. A metal flange, or rim, around the top of the sink provides support. Stainless-steel sinks typically are held in place with metal clips tightened from below (cast-iron sinks don’t need them). Self-rimming sinks are relatively easy to in- stall. However, the lip around the edge of a self- rimming sink is a great collector of kitchen debris, so these sinks are harder to keep clean than flush- mounts or undermounts. All self-rimming sinks should be sealed with a bead of silicone caulk to prevent leaks.
Better: FLUSH MOUNT
Flush-mount sinks often are called tile-edge sinks because the top edge of the sink is designed to be flush with a tile countertop. Flush-mounts are installed in much the same way as self-rimming sinks. Depending on the thickness of the tile and tile adhesive, though, the installer may have to shim or rout the edge of the counter substrate so that the sink and counter are flush. Caulk should be used to seal the sink in place as well as to fill the gap between the edge of the sink and the tile.
Best: UNDER MOUNT
Undermount sinks are tucked completely beneath the counter, so crumbs, food, and other kitchen debris can be swept easily into the sink. Installation, however, is much more exacting. The clearance hole must be cut perfectly because the surrounding edge of the countertop is completely visible once the sink is installed. Heavy under-mounts, like those made from stone or cast iron, should be supported from below.
Solid-surface undermount sinks are unique be- cause they are glued to the countertop; seams are virtually invisible. There is no chance of a leak and no place for kitchen debris to collect. A really skilled installer can make custom undermount sinks. The downside is higher cost and greater installation difficulty. This job is for a pro.
ACRYLIC: NONSTAINING AND ECONOMICAL, BUT CAN BE SOFT
A crylic sinks are made just like acrylic bathtubs and showers: A sheet of acrylic plastic is heated, then vacuum- formed in a mold and rein-forced with fibreglass and resin. The surface of an acrylic sink is nonporous, resists staining and cracking, and has good noise-dampening and heat-retention properties. Acrylic is not as hard as some other sink materials, so nonabrasive cleaners are recommended. Surface scratches can be removed with sandpaper, and the gloss restored with car-polishing compound. How- ever, acrylic is susceptible to damage from petroleum-based products and high heat.
PROS
Low cost; nonporous surface with good sound-dampening
and thermal proper-ties; dingy surfaces can be renewed.
CONS
Acrylic is relatively soft and can be damaged by high heat, abrasive cleaners, and petroleum- based products.
You don’t want to scrub too hard on an acrylic sink. The great news is that you may not need to. Some cleaners can scratch, but acrylic offers excel- lent stain resistance.
CONCRETE
Tough, with plenty of design possibilities
Concrete countertops are hot. What about concrete sinks? While very durable, concrete is an unforgiving surface for glassware, and by nature is a porous material that must be sealed carefully so that it won’t leak. Sonoma applies three coats of a penetrating sealer called Porous Plus and recommends buyers reseal their sinks once a year. Concrete is susceptible to staining, especially from acidic foods like fruit juice or wine. For those who like a sparkling sink bottom, Sonoma can cast a stainless-steel screen into the bottom of its sinks, which won’t stain.
From a design standpoint, concrete is an exceptionally flexible medium, well suited to sculptural and colour customizing.
PROS
Durable; easily customized; good sound-deadening- properties; can be cast as part of finished countertop.
COST
CONS
Expensive and heavy; may stain; must be resealed periodically.

Continua a leggere

Pubblicato in Senza categoria

"ARQUITECTURA EN ALUMINIO"

Reynaers Aluminium, líder europeo en el diseño y comercialización de sistemas de aluminio de alta calidad para la construcción y la arquitectura, presenta su nuevo catálogo “Arquitectura en aluminio” en el que se muestra la amplia gama de sistemas eficientes y de diseño de los que dispone la compañia.

Para visualizarlo hacer click aquí.

Continua a leggere

Pubblicato in Senza categoria

靜心進階課程–靜二

##ReadMore##
時間:2012年6月2、3日 (2日上午10:00前報到)
地點:然雅靜苑─台南市楠西區照興里興北73之30號
對象:此為進階課程,開放給有禪修基礎經驗者。
人數:十五人(依報名順序定)。
費用:全免。
報名方式:網路報名或來電/來函索取報名表。
報名網址
※然雅禪修課程須全程參與,無法全程參加者請勿報名。
課程內容:包括 ‧ 呼吸四相─風、喘、氣、息 ‧ 數息七階 ‧ 認識無常 ‧ 瞭解緣起 ‧ 放鬆、放下、放空 Continua a leggere

Pubblicato in Senza categoria

Le jardin de la Belle au Bois Dormant!!!!!

En regardant mon jardin, j’ai eu envie de vous le faire visiter. Pour moi, il était beau!…Beau, oui, il est bien! mais malheureusement seulement dans mon imagination!!!

Lorsque j’ai regardé les images, ma première impression : ” Le Jardin de la Belle au Bois Dormant”(. Je vous rassure, si l’on reste sur ce conte on va dire que je suis la reine et ma fille la Belle princesse…) 

J‘en profite pour vous montrer la transformation de mon ancienne table de salon (pratique pour l’appero, mais trop large pour mon salon), alors elle prend place dehors sous le platane au milieu des murets de pierres que construit le roi (encore beaucoup de boulot…. )

ASSEZ DE BLABLA  VOILA  LE JARDIN (Vivement que le prince vienne reveiller la princesse…)

juste quelques coussins le temps de la photo!!!
manque encore le joli gravier blanc, mais préssée  de vous montrer
le coin cour!!! 

tout au fond tout est au milieu et devant le gazon pousse pousse
pousse…..

point positif : mes buis sont plantés!!!!

pour ce côté: reste à planter la vegetation…

là, la mare regorge de vase et de feuilles mortes!!!

ici, au mois de mars j’avais tout désherbé assise sur mes fesses et en rampant!
mais l’herbe va beaucoup plus vie que moi!!!

les housses de mes transats  sont à refaire,  
et vous remarquerez que même le soleil est endormis!!!!

de l’herbe folle partout dans le gravier et une glycine qui s’échappeeeeee!

là, remise en route de la fontaine qui a gelée cet hivers,  mais  tout  est  au  milieu
pompe, tuyau etc…

A là, c’ est le seul coin propre, Mr  l’a nettoyé le week end dernier…

de l’herbe folle, en veux- tu, en voilà!

des iris fanes restes sur tiges!

et le nec plus ultras :  il est sencè  y avoir une fenêtre et un fênestron derrière  ce  mur  de verdure…

Jarre acheté l’année passée pour 8 euro à la fermeture d’un vieux couvent  et parterre le pollen des peupliers!!!

tuyau au milieu

pots plein de ciment

vieilles grilles acheté sur le bon coin et qui attendent sagement de rouiller  afin d’être posées

Bon en attendant le prince charmant ou que je quitte mes bequilles pour m’occuper correctement de tout ce royaume je vous montre les détails de ma table (poncée, grisée pour s’accordée aux fauteuils, tamponnée, gravée et peinte à main levée et le plateau passé au vernis marin)

pas le droit de graver le platane!!!!

Si vous n’êtes pas endormies comme la Belle, je vous souhaite une très bonne semaine!!!


Continua a leggere

Pubblicato in Senza categoria